package.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. let wasm;
  2. const heap = new Array(32);
  3. heap.fill(undefined);
  4. heap.push(undefined, null, true, false);
  5. let heap_next = heap.length;
  6. function addHeapObject(obj) {
  7. if (heap_next === heap.length) heap.push(heap.length + 1);
  8. const idx = heap_next;
  9. heap_next = heap[idx];
  10. heap[idx] = obj;
  11. return idx;
  12. }
  13. function __wbg_elem_binding0(arg0, arg1, arg2) {
  14. wasm.__wbg_function_table.get(34)(arg0, arg1, addHeapObject(arg2));
  15. }
  16. function __wbg_elem_binding1(arg0, arg1, arg2) {
  17. wasm.__wbg_function_table.get(34)(arg0, arg1, addHeapObject(arg2));
  18. }
  19. function __wbg_elem_binding2(arg0, arg1, arg2) {
  20. wasm.__wbg_function_table.get(55)(arg0, arg1, arg2);
  21. }
  22. function __wbg_elem_binding3(arg0, arg1, arg2, arg3, arg4) {
  23. wasm.__wbg_function_table.get(38)(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
  24. }
  25. function __wbg_elem_binding4(arg0, arg1, arg2, arg3) {
  26. wasm.__wbg_function_table.get(42)(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
  27. }
  28. /**
  29. */
  30. export function render() {
  31. wasm.render();
  32. }
  33. let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
  34. cachedTextDecoder.decode();
  35. let cachegetUint8Memory = null;
  36. function getUint8Memory() {
  37. if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) {
  38. cachegetUint8Memory = new Uint8Array(wasm.memory.buffer);
  39. }
  40. return cachegetUint8Memory;
  41. }
  42. function getStringFromWasm(ptr, len) {
  43. return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));
  44. }
  45. function getObject(idx) { return heap[idx]; }
  46. function dropObject(idx) {
  47. if (idx < 36) return;
  48. heap[idx] = heap_next;
  49. heap_next = idx;
  50. }
  51. function takeObject(idx) {
  52. const ret = getObject(idx);
  53. dropObject(idx);
  54. return ret;
  55. }
  56. function handleError(e) {
  57. wasm.__wbindgen_exn_store(addHeapObject(e));
  58. }
  59. function isLikeNone(x) {
  60. return x === undefined || x === null;
  61. }
  62. let WASM_VECTOR_LEN = 0;
  63. let cachedTextEncoder = new TextEncoder('utf-8');
  64. const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
  65. ? function (arg, view) {
  66. return cachedTextEncoder.encodeInto(arg, view);
  67. }
  68. : function (arg, view) {
  69. const buf = cachedTextEncoder.encode(arg);
  70. view.set(buf);
  71. return {
  72. read: arg.length,
  73. written: buf.length
  74. };
  75. });
  76. function passStringToWasm(arg) {
  77. let len = arg.length;
  78. let ptr = wasm.__wbindgen_malloc(len);
  79. const mem = getUint8Memory();
  80. let offset = 0;
  81. for (; offset < len; offset++) {
  82. const code = arg.charCodeAt(offset);
  83. if (code > 0x7F) break;
  84. mem[ptr + offset] = code;
  85. }
  86. if (offset !== len) {
  87. if (offset !== 0) {
  88. arg = arg.slice(offset);
  89. }
  90. ptr = wasm.__wbindgen_realloc(ptr, len, len = offset + arg.length * 3);
  91. const view = getUint8Memory().subarray(ptr + offset, ptr + len);
  92. const ret = encodeString(arg, view);
  93. offset += ret.written;
  94. }
  95. WASM_VECTOR_LEN = offset;
  96. return ptr;
  97. }
  98. let cachegetInt32Memory = null;
  99. function getInt32Memory() {
  100. if (cachegetInt32Memory === null || cachegetInt32Memory.buffer !== wasm.memory.buffer) {
  101. cachegetInt32Memory = new Int32Array(wasm.memory.buffer);
  102. }
  103. return cachegetInt32Memory;
  104. }
  105. function debugString(val) {
  106. // primitive types
  107. const type = typeof val;
  108. if (type == 'number' || type == 'boolean' || val == null) {
  109. return `${val}`;
  110. }
  111. if (type == 'string') {
  112. return `"${val}"`;
  113. }
  114. if (type == 'symbol') {
  115. const description = val.description;
  116. if (description == null) {
  117. return 'Symbol';
  118. } else {
  119. return `Symbol(${description})`;
  120. }
  121. }
  122. if (type == 'function') {
  123. const name = val.name;
  124. if (typeof name == 'string' && name.length > 0) {
  125. return `Function(${name})`;
  126. } else {
  127. return 'Function';
  128. }
  129. }
  130. // objects
  131. if (Array.isArray(val)) {
  132. const length = val.length;
  133. let debug = '[';
  134. if (length > 0) {
  135. debug += debugString(val[0]);
  136. }
  137. for(let i = 1; i < length; i++) {
  138. debug += ', ' + debugString(val[i]);
  139. }
  140. debug += ']';
  141. return debug;
  142. }
  143. // Test for built-in
  144. const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
  145. let className;
  146. if (builtInMatches.length > 1) {
  147. className = builtInMatches[1];
  148. } else {
  149. // Failed to match the standard '[object ClassName]'
  150. return toString.call(val);
  151. }
  152. if (className == 'Object') {
  153. // we're a user defined class or Object
  154. // JSON.stringify avoids problems with cycles, and is generally much
  155. // easier than looping through ownProperties of `val`.
  156. try {
  157. return 'Object(' + JSON.stringify(val) + ')';
  158. } catch (_) {
  159. return 'Object';
  160. }
  161. }
  162. // errors
  163. if (val instanceof Error) {
  164. return `${val.name}: ${val.message}\n${val.stack}`;
  165. }
  166. // TODO we could test for more things here, like `Set`s and `Map`s.
  167. return className;
  168. }
  169. let cachegetUint32Memory = null;
  170. function getUint32Memory() {
  171. if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) {
  172. cachegetUint32Memory = new Uint32Array(wasm.memory.buffer);
  173. }
  174. return cachegetUint32Memory;
  175. }
  176. function init(module) {
  177. if (typeof module === 'undefined') {
  178. module = import.meta.url.replace(/\.js$/, '_bg.wasm');
  179. }
  180. let result;
  181. const imports = {};
  182. imports.wbg = {};
  183. imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
  184. const ret = getStringFromWasm(arg0, arg1);
  185. return addHeapObject(ret);
  186. };
  187. imports.wbg.__widl_f_error_1_ = function(arg0) {
  188. console.error(getObject(arg0));
  189. };
  190. imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
  191. takeObject(arg0);
  192. };
  193. imports.wbg.__widl_f_cancel_animation_frame_Window = function(arg0, arg1) {
  194. try {
  195. getObject(arg0).cancelAnimationFrame(arg1);
  196. } catch (e) {
  197. handleError(e)
  198. }
  199. };
  200. imports.wbg.__widl_f_document_Window = function(arg0) {
  201. const ret = getObject(arg0).document;
  202. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  203. };
  204. imports.wbg.__widl_instanceof_HTMLInputElement = function(arg0) {
  205. const ret = getObject(arg0) instanceof HTMLInputElement;
  206. return ret;
  207. };
  208. imports.wbg.__widl_f_type_HTMLInputElement = function(arg0, arg1) {
  209. const ret = getObject(arg1).type;
  210. const ret0 = passStringToWasm(ret);
  211. const ret1 = WASM_VECTOR_LEN;
  212. getInt32Memory()[arg0 / 4 + 0] = ret0;
  213. getInt32Memory()[arg0 / 4 + 1] = ret1;
  214. };
  215. imports.wbg.__widl_instanceof_HTMLTextAreaElement = function(arg0) {
  216. const ret = getObject(arg0) instanceof HTMLTextAreaElement;
  217. return ret;
  218. };
  219. imports.wbg.__widl_f_value_HTMLTextAreaElement = function(arg0, arg1) {
  220. const ret = getObject(arg1).value;
  221. const ret0 = passStringToWasm(ret);
  222. const ret1 = WASM_VECTOR_LEN;
  223. getInt32Memory()[arg0 / 4 + 0] = ret0;
  224. getInt32Memory()[arg0 / 4 + 1] = ret1;
  225. };
  226. imports.wbg.__widl_f_value_HTMLInputElement = function(arg0, arg1) {
  227. const ret = getObject(arg1).value;
  228. const ret0 = passStringToWasm(ret);
  229. const ret1 = WASM_VECTOR_LEN;
  230. getInt32Memory()[arg0 / 4 + 0] = ret0;
  231. getInt32Memory()[arg0 / 4 + 1] = ret1;
  232. };
  233. imports.wbg.__widl_instanceof_HTMLSelectElement = function(arg0) {
  234. const ret = getObject(arg0) instanceof HTMLSelectElement;
  235. return ret;
  236. };
  237. imports.wbg.__widl_f_value_HTMLSelectElement = function(arg0, arg1) {
  238. const ret = getObject(arg1).value;
  239. const ret0 = passStringToWasm(ret);
  240. const ret1 = WASM_VECTOR_LEN;
  241. getInt32Memory()[arg0 / 4 + 0] = ret0;
  242. getInt32Memory()[arg0 / 4 + 1] = ret1;
  243. };
  244. imports.wbg.__widl_instanceof_HTMLProgressElement = function(arg0) {
  245. const ret = getObject(arg0) instanceof HTMLProgressElement;
  246. return ret;
  247. };
  248. imports.wbg.__widl_f_value_HTMLProgressElement = function(arg0) {
  249. const ret = getObject(arg0).value;
  250. return ret;
  251. };
  252. imports.wbg.__widl_instanceof_HTMLOptionElement = function(arg0) {
  253. const ret = getObject(arg0) instanceof HTMLOptionElement;
  254. return ret;
  255. };
  256. imports.wbg.__widl_f_value_HTMLOptionElement = function(arg0, arg1) {
  257. const ret = getObject(arg1).value;
  258. const ret0 = passStringToWasm(ret);
  259. const ret1 = WASM_VECTOR_LEN;
  260. getInt32Memory()[arg0 / 4 + 0] = ret0;
  261. getInt32Memory()[arg0 / 4 + 1] = ret1;
  262. };
  263. imports.wbg.__widl_instanceof_HTMLButtonElement = function(arg0) {
  264. const ret = getObject(arg0) instanceof HTMLButtonElement;
  265. return ret;
  266. };
  267. imports.wbg.__widl_f_value_HTMLButtonElement = function(arg0, arg1) {
  268. const ret = getObject(arg1).value;
  269. const ret0 = passStringToWasm(ret);
  270. const ret1 = WASM_VECTOR_LEN;
  271. getInt32Memory()[arg0 / 4 + 0] = ret0;
  272. getInt32Memory()[arg0 / 4 + 1] = ret1;
  273. };
  274. imports.wbg.__widl_instanceof_HTMLDataElement = function(arg0) {
  275. const ret = getObject(arg0) instanceof HTMLDataElement;
  276. return ret;
  277. };
  278. imports.wbg.__widl_f_value_HTMLDataElement = function(arg0, arg1) {
  279. const ret = getObject(arg1).value;
  280. const ret0 = passStringToWasm(ret);
  281. const ret1 = WASM_VECTOR_LEN;
  282. getInt32Memory()[arg0 / 4 + 0] = ret0;
  283. getInt32Memory()[arg0 / 4 + 1] = ret1;
  284. };
  285. imports.wbg.__widl_instanceof_HTMLMeterElement = function(arg0) {
  286. const ret = getObject(arg0) instanceof HTMLMeterElement;
  287. return ret;
  288. };
  289. imports.wbg.__widl_f_value_HTMLMeterElement = function(arg0) {
  290. const ret = getObject(arg0).value;
  291. return ret;
  292. };
  293. imports.wbg.__widl_instanceof_HTMLLIElement = function(arg0) {
  294. const ret = getObject(arg0) instanceof HTMLLIElement;
  295. return ret;
  296. };
  297. imports.wbg.__widl_f_value_HTMLLIElement = function(arg0) {
  298. const ret = getObject(arg0).value;
  299. return ret;
  300. };
  301. imports.wbg.__widl_instanceof_HTMLOutputElement = function(arg0) {
  302. const ret = getObject(arg0) instanceof HTMLOutputElement;
  303. return ret;
  304. };
  305. imports.wbg.__widl_f_value_HTMLOutputElement = function(arg0, arg1) {
  306. const ret = getObject(arg1).value;
  307. const ret0 = passStringToWasm(ret);
  308. const ret1 = WASM_VECTOR_LEN;
  309. getInt32Memory()[arg0 / 4 + 0] = ret0;
  310. getInt32Memory()[arg0 / 4 + 1] = ret1;
  311. };
  312. imports.wbg.__widl_instanceof_HTMLParamElement = function(arg0) {
  313. const ret = getObject(arg0) instanceof HTMLParamElement;
  314. return ret;
  315. };
  316. imports.wbg.__widl_f_value_HTMLParamElement = function(arg0, arg1) {
  317. const ret = getObject(arg1).value;
  318. const ret0 = passStringToWasm(ret);
  319. const ret1 = WASM_VECTOR_LEN;
  320. getInt32Memory()[arg0 / 4 + 0] = ret0;
  321. getInt32Memory()[arg0 / 4 + 1] = ret1;
  322. };
  323. imports.wbg.__widl_f_set_value_HTMLTextAreaElement = function(arg0, arg1, arg2) {
  324. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  325. };
  326. imports.wbg.__widl_f_active_element_Document = function(arg0) {
  327. const ret = getObject(arg0).activeElement;
  328. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  329. };
  330. imports.wbg.__widl_instanceof_Element = function(arg0) {
  331. const ret = getObject(arg0) instanceof Element;
  332. return ret;
  333. };
  334. imports.wbg.__wbg_is_6ea0f39f2d2d2335 = function(arg0, arg1) {
  335. const ret = Object.is(getObject(arg0), getObject(arg1));
  336. return ret;
  337. };
  338. imports.wbg.__widl_f_selection_start_HTMLInputElement = function(arg0, arg1) {
  339. try {
  340. const ret = getObject(arg1).selectionStart;
  341. const ret0 = !isLikeNone(ret);
  342. const ret1 = isLikeNone(ret) ? 0 : ret;
  343. getInt32Memory()[arg0 / 4 + 0] = ret0;
  344. getInt32Memory()[arg0 / 4 + 1] = ret1;
  345. } catch (e) {
  346. handleError(e)
  347. }
  348. };
  349. imports.wbg.__widl_f_selection_end_HTMLInputElement = function(arg0, arg1) {
  350. try {
  351. const ret = getObject(arg1).selectionEnd;
  352. const ret0 = !isLikeNone(ret);
  353. const ret1 = isLikeNone(ret) ? 0 : ret;
  354. getInt32Memory()[arg0 / 4 + 0] = ret0;
  355. getInt32Memory()[arg0 / 4 + 1] = ret1;
  356. } catch (e) {
  357. handleError(e)
  358. }
  359. };
  360. imports.wbg.__widl_f_set_value_HTMLInputElement = function(arg0, arg1, arg2) {
  361. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  362. };
  363. imports.wbg.__widl_f_set_selection_start_HTMLInputElement = function(arg0, arg1, arg2) {
  364. try {
  365. getObject(arg0).selectionStart = arg1 === 0 ? undefined : arg2 >>> 0;
  366. } catch (e) {
  367. handleError(e)
  368. }
  369. };
  370. imports.wbg.__widl_f_set_selection_end_HTMLInputElement = function(arg0, arg1, arg2) {
  371. try {
  372. getObject(arg0).selectionEnd = arg1 === 0 ? undefined : arg2 >>> 0;
  373. } catch (e) {
  374. handleError(e)
  375. }
  376. };
  377. imports.wbg.__widl_f_set_value_HTMLSelectElement = function(arg0, arg1, arg2) {
  378. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  379. };
  380. imports.wbg.__widl_f_set_value_HTMLOptionElement = function(arg0, arg1, arg2) {
  381. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  382. };
  383. imports.wbg.__widl_f_set_value_HTMLProgressElement = function(arg0, arg1) {
  384. getObject(arg0).value = arg1;
  385. };
  386. imports.wbg.__widl_f_set_value_HTMLButtonElement = function(arg0, arg1, arg2) {
  387. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  388. };
  389. imports.wbg.__widl_f_set_value_HTMLDataElement = function(arg0, arg1, arg2) {
  390. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  391. };
  392. imports.wbg.__widl_f_set_value_HTMLMeterElement = function(arg0, arg1) {
  393. getObject(arg0).value = arg1;
  394. };
  395. imports.wbg.__widl_f_set_value_HTMLOutputElement = function(arg0, arg1, arg2) {
  396. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  397. };
  398. imports.wbg.__widl_f_set_value_HTMLParamElement = function(arg0, arg1, arg2) {
  399. getObject(arg0).value = getStringFromWasm(arg1, arg2);
  400. };
  401. imports.wbg.__widl_f_set_value_HTMLLIElement = function(arg0, arg1) {
  402. getObject(arg0).value = arg1;
  403. };
  404. imports.wbg.__widl_f_set_checked_HTMLInputElement = function(arg0, arg1) {
  405. getObject(arg0).checked = arg1 !== 0;
  406. };
  407. imports.wbg.__widl_instanceof_HTMLMenuItemElement = function(arg0) {
  408. const ret = getObject(arg0) instanceof HTMLMenuItemElement;
  409. return ret;
  410. };
  411. imports.wbg.__widl_f_set_checked_HTMLMenuItemElement = function(arg0, arg1) {
  412. getObject(arg0).checked = arg1 !== 0;
  413. };
  414. imports.wbg.__widl_f_get_element_by_id_Document = function(arg0, arg1, arg2) {
  415. const ret = getObject(arg0).getElementById(getStringFromWasm(arg1, arg2));
  416. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  417. };
  418. imports.wbg.__widl_f_set_attribute_Element = function(arg0, arg1, arg2, arg3, arg4) {
  419. try {
  420. getObject(arg0).setAttribute(getStringFromWasm(arg1, arg2), getStringFromWasm(arg3, arg4));
  421. } catch (e) {
  422. handleError(e)
  423. }
  424. };
  425. imports.wbg.__widl_f_node_type_Node = function(arg0) {
  426. const ret = getObject(arg0).nodeType;
  427. return ret;
  428. };
  429. imports.wbg.__widl_f_remove_attribute_Element = function(arg0, arg1, arg2) {
  430. try {
  431. getObject(arg0).removeAttribute(getStringFromWasm(arg1, arg2));
  432. } catch (e) {
  433. handleError(e)
  434. }
  435. };
  436. imports.wbg.__widl_f_append_child_Node = function(arg0, arg1) {
  437. try {
  438. const ret = getObject(arg0).appendChild(getObject(arg1));
  439. return addHeapObject(ret);
  440. } catch (e) {
  441. handleError(e)
  442. }
  443. };
  444. imports.wbg.__widl_f_insert_before_Node = function(arg0, arg1, arg2) {
  445. try {
  446. const ret = getObject(arg0).insertBefore(getObject(arg1), getObject(arg2));
  447. return addHeapObject(ret);
  448. } catch (e) {
  449. handleError(e)
  450. }
  451. };
  452. imports.wbg.__widl_f_pathname_URL = function(arg0, arg1) {
  453. const ret = getObject(arg1).pathname;
  454. const ret0 = passStringToWasm(ret);
  455. const ret1 = WASM_VECTOR_LEN;
  456. getInt32Memory()[arg0 / 4 + 0] = ret0;
  457. getInt32Memory()[arg0 / 4 + 1] = ret1;
  458. };
  459. imports.wbg.__widl_f_hash_URL = function(arg0, arg1) {
  460. const ret = getObject(arg1).hash;
  461. const ret0 = passStringToWasm(ret);
  462. const ret1 = WASM_VECTOR_LEN;
  463. getInt32Memory()[arg0 / 4 + 0] = ret0;
  464. getInt32Memory()[arg0 / 4 + 1] = ret1;
  465. };
  466. imports.wbg.__widl_f_search_URL = function(arg0, arg1) {
  467. const ret = getObject(arg1).search;
  468. const ret0 = passStringToWasm(ret);
  469. const ret1 = WASM_VECTOR_LEN;
  470. getInt32Memory()[arg0 / 4 + 0] = ret0;
  471. getInt32Memory()[arg0 / 4 + 1] = ret1;
  472. };
  473. imports.wbg.__widl_f_new_with_base_URL = function(arg0, arg1, arg2, arg3) {
  474. try {
  475. const ret = new URL(getStringFromWasm(arg0, arg1), getStringFromWasm(arg2, arg3));
  476. return addHeapObject(ret);
  477. } catch (e) {
  478. handleError(e)
  479. }
  480. };
  481. imports.wbg.__widl_f_location_Window = function(arg0) {
  482. const ret = getObject(arg0).location;
  483. return addHeapObject(ret);
  484. };
  485. imports.wbg.__widl_f_href_Location = function(arg0, arg1) {
  486. try {
  487. const ret = getObject(arg1).href;
  488. const ret0 = passStringToWasm(ret);
  489. const ret1 = WASM_VECTOR_LEN;
  490. getInt32Memory()[arg0 / 4 + 0] = ret0;
  491. getInt32Memory()[arg0 / 4 + 1] = ret1;
  492. } catch (e) {
  493. handleError(e)
  494. }
  495. };
  496. imports.wbg.__widl_f_new_URL = function(arg0, arg1) {
  497. try {
  498. const ret = new URL(getStringFromWasm(arg0, arg1));
  499. return addHeapObject(ret);
  500. } catch (e) {
  501. handleError(e)
  502. }
  503. };
  504. imports.wbg.__wbg_resolve_3457814e095bea39 = function(arg0) {
  505. const ret = Promise.resolve(getObject(arg0));
  506. return addHeapObject(ret);
  507. };
  508. imports.wbg.__wbg_then_2b35dcc92370b6f9 = function(arg0, arg1, arg2) {
  509. const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
  510. return addHeapObject(ret);
  511. };
  512. imports.wbg.__wbindgen_cb_drop = function(arg0) {
  513. const obj = takeObject(arg0).original;
  514. if (obj.cnt-- == 1) {
  515. obj.a = 0;
  516. return true;
  517. }
  518. const ret = false;
  519. return ret;
  520. };
  521. imports.wbg.__wbg_new_59cb74e423758ede = function() {
  522. const ret = new Error();
  523. return addHeapObject(ret);
  524. };
  525. imports.wbg.__wbg_stack_558ba5917b466edd = function(arg0, arg1) {
  526. const ret = getObject(arg1).stack;
  527. const ret0 = passStringToWasm(ret);
  528. const ret1 = WASM_VECTOR_LEN;
  529. getInt32Memory()[arg0 / 4 + 0] = ret0;
  530. getInt32Memory()[arg0 / 4 + 1] = ret1;
  531. };
  532. imports.wbg.__wbg_error_4bb6c2a97407129a = function(arg0, arg1) {
  533. const v0 = getStringFromWasm(arg0, arg1).slice();
  534. wasm.__wbindgen_free(arg0, arg1 * 1);
  535. console.error(v0);
  536. };
  537. imports.wbg.__wbg_globalThis_e18edfcaa69970d7 = function() {
  538. try {
  539. const ret = globalThis.globalThis;
  540. return addHeapObject(ret);
  541. } catch (e) {
  542. handleError(e)
  543. }
  544. };
  545. imports.wbg.__wbg_self_c263ff272c9c2d42 = function() {
  546. try {
  547. const ret = self.self;
  548. return addHeapObject(ret);
  549. } catch (e) {
  550. handleError(e)
  551. }
  552. };
  553. imports.wbg.__wbg_window_043622d0c8518027 = function() {
  554. try {
  555. const ret = window.window;
  556. return addHeapObject(ret);
  557. } catch (e) {
  558. handleError(e)
  559. }
  560. };
  561. imports.wbg.__wbg_global_7e97ac1b8ea927d0 = function() {
  562. try {
  563. const ret = global.global;
  564. return addHeapObject(ret);
  565. } catch (e) {
  566. handleError(e)
  567. }
  568. };
  569. imports.wbg.__wbindgen_is_undefined = function(arg0) {
  570. const ret = getObject(arg0) === undefined;
  571. return ret;
  572. };
  573. imports.wbg.__wbg_newnoargs_ccf8cbd1628a0c21 = function(arg0, arg1) {
  574. const ret = new Function(getStringFromWasm(arg0, arg1));
  575. return addHeapObject(ret);
  576. };
  577. imports.wbg.__wbg_call_1c71dead4ddfc1a7 = function(arg0, arg1) {
  578. try {
  579. const ret = getObject(arg0).call(getObject(arg1));
  580. return addHeapObject(ret);
  581. } catch (e) {
  582. handleError(e)
  583. }
  584. };
  585. imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
  586. const ret = getObject(arg0);
  587. return addHeapObject(ret);
  588. };
  589. imports.wbg.__widl_instanceof_Window = function(arg0) {
  590. const ret = getObject(arg0) instanceof Window;
  591. return ret;
  592. };
  593. imports.wbg.__wbg_new_2d18bd51e2172a0d = function(arg0, arg1) {
  594. const state0 = {a: arg0, b: arg1};
  595. const cb0 = (arg0, arg1) => {
  596. const a = state0.a;
  597. state0.a = 0;
  598. try {
  599. return __wbg_elem_binding4(a, state0.b, arg0, arg1);
  600. } finally {
  601. state0.a = a;
  602. }
  603. };
  604. try {
  605. const ret = new Promise(cb0);
  606. return addHeapObject(ret);
  607. } finally {
  608. state0.a = state0.b = 0;
  609. }
  610. };
  611. imports.wbg.__wbg_call_9a450f735fcf1a81 = function(arg0, arg1, arg2) {
  612. try {
  613. const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
  614. return addHeapObject(ret);
  615. } catch (e) {
  616. handleError(e)
  617. }
  618. };
  619. imports.wbg.__wbg_then_f8ceb6d7f2902004 = function(arg0, arg1) {
  620. const ret = getObject(arg0).then(getObject(arg1));
  621. return addHeapObject(ret);
  622. };
  623. imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
  624. const ret = debugString(getObject(arg1));
  625. const ret0 = passStringToWasm(ret);
  626. const ret1 = WASM_VECTOR_LEN;
  627. getInt32Memory()[arg0 / 4 + 0] = ret0;
  628. getInt32Memory()[arg0 / 4 + 1] = ret1;
  629. };
  630. imports.wbg.__wbindgen_throw = function(arg0, arg1) {
  631. throw new Error(getStringFromWasm(arg0, arg1));
  632. };
  633. imports.wbg.__widl_f_performance_Window = function(arg0) {
  634. const ret = getObject(arg0).performance;
  635. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  636. };
  637. imports.wbg.__widl_f_now_Performance = function(arg0) {
  638. const ret = getObject(arg0).now();
  639. return ret;
  640. };
  641. imports.wbg.__widl_f_add_event_listener_with_callback_EventTarget = function(arg0, arg1, arg2, arg3) {
  642. try {
  643. getObject(arg0).addEventListener(getStringFromWasm(arg1, arg2), getObject(arg3));
  644. } catch (e) {
  645. handleError(e)
  646. }
  647. };
  648. imports.wbg.__widl_f_request_animation_frame_Window = function(arg0, arg1) {
  649. try {
  650. const ret = getObject(arg0).requestAnimationFrame(getObject(arg1));
  651. return ret;
  652. } catch (e) {
  653. handleError(e)
  654. }
  655. };
  656. imports.wbg.__widl_f_target_Event = function(arg0) {
  657. const ret = getObject(arg0).target;
  658. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  659. };
  660. imports.wbg.__widl_f_closest_Element = function(arg0, arg1, arg2) {
  661. try {
  662. const ret = getObject(arg0).closest(getStringFromWasm(arg1, arg2));
  663. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  664. } catch (e) {
  665. handleError(e)
  666. }
  667. };
  668. imports.wbg.__widl_f_tag_name_Element = function(arg0, arg1) {
  669. const ret = getObject(arg1).tagName;
  670. const ret0 = passStringToWasm(ret);
  671. const ret1 = WASM_VECTOR_LEN;
  672. getInt32Memory()[arg0 / 4 + 0] = ret0;
  673. getInt32Memory()[arg0 / 4 + 1] = ret1;
  674. };
  675. imports.wbg.__widl_f_get_attribute_Element = function(arg0, arg1, arg2, arg3) {
  676. const ret = getObject(arg1).getAttribute(getStringFromWasm(arg2, arg3));
  677. const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret);
  678. const len0 = WASM_VECTOR_LEN;
  679. const ret0 = ptr0;
  680. const ret1 = len0;
  681. getInt32Memory()[arg0 / 4 + 0] = ret0;
  682. getInt32Memory()[arg0 / 4 + 1] = ret1;
  683. };
  684. imports.wbg.__widl_f_prevent_default_Event = function(arg0) {
  685. getObject(arg0).preventDefault();
  686. };
  687. imports.wbg.__widl_f_history_Window = function(arg0) {
  688. try {
  689. const ret = getObject(arg0).history;
  690. return addHeapObject(ret);
  691. } catch (e) {
  692. handleError(e)
  693. }
  694. };
  695. imports.wbg.__widl_f_push_state_with_url_History = function(arg0, arg1, arg2, arg3, arg4, arg5) {
  696. try {
  697. getObject(arg0).pushState(getObject(arg1), getStringFromWasm(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm(arg4, arg5));
  698. } catch (e) {
  699. handleError(e)
  700. }
  701. };
  702. imports.wbg.__widl_instanceof_PopStateEvent = function(arg0) {
  703. const ret = getObject(arg0) instanceof PopStateEvent;
  704. return ret;
  705. };
  706. imports.wbg.__widl_f_state_PopStateEvent = function(arg0) {
  707. const ret = getObject(arg0).state;
  708. return addHeapObject(ret);
  709. };
  710. imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
  711. const obj = getObject(arg0);
  712. if (typeof(obj) !== 'string') return 0;
  713. const ptr = passStringToWasm(obj);
  714. getUint32Memory()[arg1 / 4] = WASM_VECTOR_LEN;
  715. const ret = ptr;
  716. return ret;
  717. };
  718. imports.wbg.__widl_instanceof_HashChangeEvent = function(arg0) {
  719. const ret = getObject(arg0) instanceof HashChangeEvent;
  720. return ret;
  721. };
  722. imports.wbg.__widl_f_new_url_HashChangeEvent = function(arg0, arg1) {
  723. const ret = getObject(arg1).newURL;
  724. const ret0 = passStringToWasm(ret);
  725. const ret1 = WASM_VECTOR_LEN;
  726. getInt32Memory()[arg0 / 4 + 0] = ret0;
  727. getInt32Memory()[arg0 / 4 + 1] = ret1;
  728. };
  729. imports.wbg.__widl_f_remove_event_listener_with_callback_EventTarget = function(arg0, arg1, arg2, arg3) {
  730. try {
  731. getObject(arg0).removeEventListener(getStringFromWasm(arg1, arg2), getObject(arg3));
  732. } catch (e) {
  733. handleError(e)
  734. }
  735. };
  736. imports.wbg.__widl_f_get_attribute_names_Element = function(arg0) {
  737. const ret = getObject(arg0).getAttributeNames();
  738. return addHeapObject(ret);
  739. };
  740. imports.wbg.__wbg_forEach_233111cfe44b80fc = function(arg0, arg1, arg2) {
  741. const state0 = {a: arg1, b: arg2};
  742. const cb0 = (arg0, arg1, arg2) => {
  743. const a = state0.a;
  744. state0.a = 0;
  745. try {
  746. return __wbg_elem_binding3(a, state0.b, arg0, arg1, arg2);
  747. } finally {
  748. state0.a = a;
  749. }
  750. };
  751. try {
  752. getObject(arg0).forEach(cb0);
  753. } finally {
  754. state0.a = state0.b = 0;
  755. }
  756. };
  757. imports.wbg.__widl_f_namespace_uri_Element = function(arg0, arg1) {
  758. const ret = getObject(arg1).namespaceURI;
  759. const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret);
  760. const len0 = WASM_VECTOR_LEN;
  761. const ret0 = ptr0;
  762. const ret1 = len0;
  763. getInt32Memory()[arg0 / 4 + 0] = ret0;
  764. getInt32Memory()[arg0 / 4 + 1] = ret1;
  765. };
  766. imports.wbg.__widl_f_child_nodes_Node = function(arg0) {
  767. const ret = getObject(arg0).childNodes;
  768. return addHeapObject(ret);
  769. };
  770. imports.wbg.__widl_f_length_NodeList = function(arg0) {
  771. const ret = getObject(arg0).length;
  772. return ret;
  773. };
  774. imports.wbg.__widl_f_get_NodeList = function(arg0, arg1) {
  775. const ret = getObject(arg0)[arg1 >>> 0];
  776. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  777. };
  778. imports.wbg.__widl_f_text_content_Node = function(arg0, arg1) {
  779. const ret = getObject(arg1).textContent;
  780. const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret);
  781. const len0 = WASM_VECTOR_LEN;
  782. const ret0 = ptr0;
  783. const ret1 = len0;
  784. getInt32Memory()[arg0 / 4 + 0] = ret0;
  785. getInt32Memory()[arg0 / 4 + 1] = ret1;
  786. };
  787. imports.wbg.__widl_f_next_sibling_Node = function(arg0) {
  788. const ret = getObject(arg0).nextSibling;
  789. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  790. };
  791. imports.wbg.__widl_f_first_child_Node = function(arg0) {
  792. const ret = getObject(arg0).firstChild;
  793. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  794. };
  795. imports.wbg.__widl_f_remove_child_Node = function(arg0, arg1) {
  796. try {
  797. const ret = getObject(arg0).removeChild(getObject(arg1));
  798. return addHeapObject(ret);
  799. } catch (e) {
  800. handleError(e)
  801. }
  802. };
  803. imports.wbg.__widl_f_set_text_content_Node = function(arg0, arg1, arg2) {
  804. getObject(arg0).textContent = arg1 === 0 ? undefined : getStringFromWasm(arg1, arg2);
  805. };
  806. imports.wbg.__widl_f_create_text_node_Document = function(arg0, arg1, arg2) {
  807. const ret = getObject(arg0).createTextNode(getStringFromWasm(arg1, arg2));
  808. return addHeapObject(ret);
  809. };
  810. imports.wbg.__widl_instanceof_Node = function(arg0) {
  811. const ret = getObject(arg0) instanceof Node;
  812. return ret;
  813. };
  814. imports.wbg.__widl_f_replace_child_Node = function(arg0, arg1, arg2) {
  815. try {
  816. const ret = getObject(arg0).replaceChild(getObject(arg1), getObject(arg2));
  817. return addHeapObject(ret);
  818. } catch (e) {
  819. handleError(e)
  820. }
  821. };
  822. imports.wbg.__widl_f_create_element_ns_Document = function(arg0, arg1, arg2, arg3, arg4) {
  823. try {
  824. const ret = getObject(arg0).createElementNS(arg1 === 0 ? undefined : getStringFromWasm(arg1, arg2), getStringFromWasm(arg3, arg4));
  825. return addHeapObject(ret);
  826. } catch (e) {
  827. handleError(e)
  828. }
  829. };
  830. imports.wbg.__widl_f_create_element_Document = function(arg0, arg1, arg2) {
  831. try {
  832. const ret = getObject(arg0).createElement(getStringFromWasm(arg1, arg2));
  833. return addHeapObject(ret);
  834. } catch (e) {
  835. handleError(e)
  836. }
  837. };
  838. imports.wbg.__widl_instanceof_HTMLElement = function(arg0) {
  839. const ret = getObject(arg0) instanceof HTMLElement;
  840. return ret;
  841. };
  842. imports.wbg.__widl_f_focus_HTMLElement = function(arg0) {
  843. try {
  844. getObject(arg0).focus();
  845. } catch (e) {
  846. handleError(e)
  847. }
  848. };
  849. imports.wbg.__widl_f_query_selector_Document = function(arg0, arg1, arg2) {
  850. try {
  851. const ret = getObject(arg0).querySelector(getStringFromWasm(arg1, arg2));
  852. return isLikeNone(ret) ? 0 : addHeapObject(ret);
  853. } catch (e) {
  854. handleError(e)
  855. }
  856. };
  857. imports.wbg.__wbindgen_cb_forget = function(arg0) {
  858. takeObject(arg0);
  859. };
  860. imports.wbg.__wbindgen_closure_wrapper273 = function(arg0, arg1, arg2) {
  861. const state = { a: arg0, b: arg1, cnt: 1 };
  862. const real = (arg0) => {
  863. state.cnt++;
  864. const a = state.a;
  865. state.a = 0;
  866. try {
  867. return __wbg_elem_binding0(a, state.b, arg0);
  868. } finally {
  869. if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b);
  870. else state.a = a;
  871. }
  872. }
  873. ;
  874. real.original = state;
  875. const ret = real;
  876. return addHeapObject(ret);
  877. };
  878. imports.wbg.__wbindgen_closure_wrapper769 = function(arg0, arg1, arg2) {
  879. const state = { a: arg0, b: arg1, cnt: 1 };
  880. const real = (arg0) => {
  881. state.cnt++;
  882. const a = state.a;
  883. state.a = 0;
  884. try {
  885. return __wbg_elem_binding1(a, state.b, arg0);
  886. } finally {
  887. if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b);
  888. else state.a = a;
  889. }
  890. }
  891. ;
  892. real.original = state;
  893. const ret = real;
  894. return addHeapObject(ret);
  895. };
  896. imports.wbg.__wbindgen_closure_wrapper772 = function(arg0, arg1, arg2) {
  897. const state = { a: arg0, b: arg1, cnt: 1 };
  898. const real = (arg0) => {
  899. state.cnt++;
  900. const a = state.a;
  901. state.a = 0;
  902. try {
  903. return __wbg_elem_binding2(a, state.b, arg0);
  904. } finally {
  905. if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b);
  906. else state.a = a;
  907. }
  908. }
  909. ;
  910. real.original = state;
  911. const ret = real;
  912. return addHeapObject(ret);
  913. };
  914. if ((typeof URL === 'function' && module instanceof URL) || typeof module === 'string' || (typeof Request === 'function' && module instanceof Request)) {
  915. const response = fetch(module);
  916. if (typeof WebAssembly.instantiateStreaming === 'function') {
  917. result = WebAssembly.instantiateStreaming(response, imports)
  918. .catch(e => {
  919. return response
  920. .then(r => {
  921. if (r.headers.get('Content-Type') != 'application/wasm') {
  922. console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
  923. return r.arrayBuffer();
  924. } else {
  925. throw e;
  926. }
  927. })
  928. .then(bytes => WebAssembly.instantiate(bytes, imports));
  929. });
  930. } else {
  931. result = response
  932. .then(r => r.arrayBuffer())
  933. .then(bytes => WebAssembly.instantiate(bytes, imports));
  934. }
  935. } else {
  936. result = WebAssembly.instantiate(module, imports)
  937. .then(result => {
  938. if (result instanceof WebAssembly.Instance) {
  939. return { instance: result, module };
  940. } else {
  941. return result;
  942. }
  943. });
  944. }
  945. return result.then(({instance, module}) => {
  946. wasm = instance.exports;
  947. init.__wbindgen_wasm_module = module;
  948. wasm.__wbindgen_start();
  949. return wasm;
  950. });
  951. }
  952. export default init;