@neteasecloudmusicapienhanced/api 4.29.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.MD +178 -0
- package/app.js +18 -0
- package/data/deviceid.txt +24641 -0
- package/generateConfig.js +24 -0
- package/interface.d.ts +1834 -0
- package/main.js +63 -0
- package/module/activate_init_profile.js +9 -0
- package/module/aidj_content_rcmd.js +28 -0
- package/module/album.js +6 -0
- package/module/album_detail.js +12 -0
- package/module/album_detail_dynamic.js +12 -0
- package/module/album_list.js +16 -0
- package/module/album_list_style.js +15 -0
- package/module/album_new.js +11 -0
- package/module/album_newest.js +6 -0
- package/module/album_privilege.js +9 -0
- package/module/album_songsaleboard.js +19 -0
- package/module/album_sub.js +10 -0
- package/module/album_sublist.js +11 -0
- package/module/api.js +21 -0
- package/module/artist_album.js +15 -0
- package/module/artist_desc.js +9 -0
- package/module/artist_detail.js +10 -0
- package/module/artist_detail_dynamic.js +9 -0
- package/module/artist_fans.js +11 -0
- package/module/artist_follow_count.js +13 -0
- package/module/artist_list.js +33 -0
- package/module/artist_mv.js +12 -0
- package/module/artist_new_mv.js +12 -0
- package/module/artist_new_song.js +12 -0
- package/module/artist_songs.js +12 -0
- package/module/artist_sub.js +11 -0
- package/module/artist_sublist.js +11 -0
- package/module/artist_top_song.js +8 -0
- package/module/artist_video.js +15 -0
- package/module/artists.js +6 -0
- package/module/audio_match.js +19 -0
- package/module/avatar_upload.js +22 -0
- package/module/banner.js +16 -0
- package/module/batch.js +12 -0
- package/module/broadcast_category_region_get.js +11 -0
- package/module/broadcast_channel_collect_list.js +12 -0
- package/module/broadcast_channel_currentinfo.js +13 -0
- package/module/broadcast_channel_list.js +13 -0
- package/module/broadcast_sub.js +12 -0
- package/module/calendar.js +8 -0
- package/module/captcha_sent.js +11 -0
- package/module/captcha_verify.js +11 -0
- package/module/cellphone_existence_check.js +10 -0
- package/module/check_music.js +30 -0
- package/module/cloud.js +146 -0
- package/module/cloud_import.js +39 -0
- package/module/cloud_match.js +13 -0
- package/module/cloudsearch.js +13 -0
- package/module/comment.js +30 -0
- package/module/comment_album.js +16 -0
- package/module/comment_dj.js +16 -0
- package/module/comment_event.js +15 -0
- package/module/comment_floor.js +16 -0
- package/module/comment_hot.js +18 -0
- package/module/comment_hug_list.js +20 -0
- package/module/comment_like.js +20 -0
- package/module/comment_music.js +16 -0
- package/module/comment_mv.js +16 -0
- package/module/comment_new.js +37 -0
- package/module/comment_playlist.js +16 -0
- package/module/comment_video.js +16 -0
- package/module/countries_code_list.js +6 -0
- package/module/creator_authinfo_get.js +6 -0
- package/module/daily_signin.js +16 -0
- package/module/digitalAlbum_detail.js +13 -0
- package/module/digitalAlbum_ordering.js +22 -0
- package/module/digitalAlbum_purchased.js +15 -0
- package/module/digitalAlbum_sales.js +13 -0
- package/module/djRadio_top.js +15 -0
- package/module/dj_banner.js +6 -0
- package/module/dj_category_excludehot.js +10 -0
- package/module/dj_category_recommend.js +10 -0
- package/module/dj_catelist.js +6 -0
- package/module/dj_detail.js +9 -0
- package/module/dj_hot.js +10 -0
- package/module/dj_paygift.js +15 -0
- package/module/dj_personalize_recommend.js +12 -0
- package/module/dj_program.js +12 -0
- package/module/dj_program_detail.js +9 -0
- package/module/dj_program_toplist.js +10 -0
- package/module/dj_program_toplist_hours.js +13 -0
- package/module/dj_radio_hot.js +11 -0
- package/module/dj_recommend.js +6 -0
- package/module/dj_recommend_type.js +32 -0
- package/module/dj_sub.js +10 -0
- package/module/dj_sublist.js +11 -0
- package/module/dj_subscriber.js +12 -0
- package/module/dj_today_perfered.js +13 -0
- package/module/dj_toplist.js +14 -0
- package/module/dj_toplist_hours.js +10 -0
- package/module/dj_toplist_newcomer.js +9 -0
- package/module/dj_toplist_pay.js +9 -0
- package/module/dj_toplist_popular.js +10 -0
- package/module/eapi_decrypt.js +27 -0
- package/module/event.js +10 -0
- package/module/event_del.js +9 -0
- package/module/event_forward.js +11 -0
- package/module/fanscenter_basicinfo_age_get.js +6 -0
- package/module/fanscenter_basicinfo_gender_get.js +10 -0
- package/module/fanscenter_basicinfo_province_get.js +10 -0
- package/module/fanscenter_overview_get.js +6 -0
- package/module/fanscenter_trend_list.js +10 -0
- package/module/fm_trash.js +11 -0
- package/module/follow.js +11 -0
- package/module/get_userids.js +7 -0
- package/module/history_recommend_songs.js +11 -0
- package/module/history_recommend_songs_detail.js +13 -0
- package/module/homepage_block_page.js +8 -0
- package/module/homepage_dragon_ball.js +10 -0
- package/module/hot_topic.js +10 -0
- package/module/hug_comment.js +16 -0
- package/module/inner_version.js +16 -0
- package/module/like.js +13 -0
- package/module/likelist.js +9 -0
- package/module/listen_data_realtime_report.js +11 -0
- package/module/listen_data_report.js +12 -0
- package/module/listen_data_today_song.js +9 -0
- package/module/listen_data_total.js +9 -0
- package/module/listen_data_year_report.js +9 -0
- package/module/listentogether_accept.js +13 -0
- package/module/listentogether_end.js +9 -0
- package/module/listentogether_heatbeat.js +12 -0
- package/module/listentogether_play_command.js +21 -0
- package/module/listentogether_room_check.js +9 -0
- package/module/listentogether_room_create.js +9 -0
- package/module/listentogether_status.js +10 -0
- package/module/listentogether_sync_list_command.js +26 -0
- package/module/listentogether_sync_playlist_get.js +13 -0
- package/module/login.js +41 -0
- package/module/login_cellphone.js +40 -0
- package/module/login_qr_check.js +29 -0
- package/module/login_qr_create.js +30 -0
- package/module/login_qr_key.js +19 -0
- package/module/login_refresh.js +21 -0
- package/module/login_status.js +21 -0
- package/module/logout.js +6 -0
- package/module/lyric.js +14 -0
- package/module/lyric_new.js +17 -0
- package/module/mlog_music_rcmd.js +13 -0
- package/module/mlog_to_video.js +13 -0
- package/module/mlog_url.js +11 -0
- package/module/msg_comments.js +17 -0
- package/module/msg_forwards.js +11 -0
- package/module/msg_notices.js +10 -0
- package/module/msg_private.js +11 -0
- package/module/msg_private_history.js +12 -0
- package/module/msg_recentcontact.js +11 -0
- package/module/music_first_listen_info.js +13 -0
- package/module/musician_cloudbean.js +7 -0
- package/module/musician_cloudbean_obtain.js +14 -0
- package/module/musician_data_overview.js +11 -0
- package/module/musician_play_trend.js +14 -0
- package/module/musician_sign.js +7 -0
- package/module/musician_tasks.js +11 -0
- package/module/musician_tasks_new.js +11 -0
- package/module/mv_all.js +16 -0
- package/module/mv_detail.js +9 -0
- package/module/mv_detail_info.js +14 -0
- package/module/mv_exclusive_rcmd.js +10 -0
- package/module/mv_first.js +12 -0
- package/module/mv_sub.js +11 -0
- package/module/mv_sublist.js +15 -0
- package/module/mv_url.js +14 -0
- package/module/nickname_check.js +7 -0
- package/module/personal_fm.js +6 -0
- package/module/personal_fm_mode.js +14 -0
- package/module/personalized.js +16 -0
- package/module/personalized_djprogram.js +10 -0
- package/module/personalized_mv.js +6 -0
- package/module/personalized_newsong.js +15 -0
- package/module/personalized_privatecontent.js +10 -0
- package/module/personalized_privatecontent_list.js +15 -0
- package/module/pl_count.js +6 -0
- package/module/playlist_category_list.js +11 -0
- package/module/playlist_catlist.js +6 -0
- package/module/playlist_cover_update.js +32 -0
- package/module/playlist_create.js +11 -0
- package/module/playlist_delete.js +9 -0
- package/module/playlist_desc_update.js +10 -0
- package/module/playlist_detail.js +11 -0
- package/module/playlist_detail_dynamic.js +11 -0
- package/module/playlist_detail_rcmd_get.js +11 -0
- package/module/playlist_highquality_tags.js +10 -0
- package/module/playlist_hot.js +6 -0
- package/module/playlist_import_name_task_create.js +62 -0
- package/module/playlist_import_task_status.js +11 -0
- package/module/playlist_mylike.js +12 -0
- package/module/playlist_name_update.js +10 -0
- package/module/playlist_order_update.js +13 -0
- package/module/playlist_privacy.js +10 -0
- package/module/playlist_subscribe.js +14 -0
- package/module/playlist_subscribers.js +11 -0
- package/module/playlist_tags_update.js +10 -0
- package/module/playlist_track_add.js +16 -0
- package/module/playlist_track_all.js +31 -0
- package/module/playlist_track_delete.js +20 -0
- package/module/playlist_tracks.js +45 -0
- package/module/playlist_update.js +13 -0
- package/module/playlist_update_playcount.js +9 -0
- package/module/playlist_video_recent.js +9 -0
- package/module/playmode_intelligence_list.js +13 -0
- package/module/playmode_song_vector.js +8 -0
- package/module/program_recommend.js +15 -0
- package/module/rebind.js +16 -0
- package/module/recent_listen_list.js +7 -0
- package/module/recommend_resource.js +10 -0
- package/module/recommend_songs.js +11 -0
- package/module/recommend_songs_dislike.js +14 -0
- package/module/record_recent_album.js +11 -0
- package/module/record_recent_dj.js +11 -0
- package/module/record_recent_playlist.js +11 -0
- package/module/record_recent_song.js +11 -0
- package/module/record_recent_video.js +11 -0
- package/module/record_recent_voice.js +11 -0
- package/module/register_anonimous.js +52 -0
- package/module/register_cellphone.js +15 -0
- package/module/related_allvideo.js +14 -0
- package/module/related_playlist.js +32 -0
- package/module/resource_like.js +14 -0
- package/module/scrobble.js +26 -0
- package/module/search.js +21 -0
- package/module/search_default.js +6 -0
- package/module/search_hot.js +9 -0
- package/module/search_hot_detail.js +6 -0
- package/module/search_match.js +18 -0
- package/module/search_multimatch.js +14 -0
- package/module/search_suggest.js +14 -0
- package/module/send_album.js +12 -0
- package/module/send_playlist.js +12 -0
- package/module/send_song.js +12 -0
- package/module/send_text.js +11 -0
- package/module/setting.js +7 -0
- package/module/share_resource.js +11 -0
- package/module/sheet_list.js +9 -0
- package/module/sheet_preview.js +8 -0
- package/module/sign_happy_info.js +5 -0
- package/module/signin_progress.js +13 -0
- package/module/simi_artist.js +12 -0
- package/module/simi_mv.js +9 -0
- package/module/simi_playlist.js +15 -0
- package/module/simi_song.js +15 -0
- package/module/simi_user.js +11 -0
- package/module/song_chorus.js +11 -0
- package/module/song_detail.js +11 -0
- package/module/song_downlist.js +11 -0
- package/module/song_download_url.js +10 -0
- package/module/song_download_url_v1.js +13 -0
- package/module/song_dynamic_cover.js +9 -0
- package/module/song_like_check.js +9 -0
- package/module/song_lyrics_mark.js +9 -0
- package/module/song_lyrics_mark_add.js +12 -0
- package/module/song_lyrics_mark_del.js +9 -0
- package/module/song_lyrics_mark_user_page.js +14 -0
- package/module/song_monthdownlist.js +11 -0
- package/module/song_music_detail.js +9 -0
- package/module/song_order_update.js +12 -0
- package/module/song_purchased.js +14 -0
- package/module/song_red_count.js +9 -0
- package/module/song_singledownlist.js +11 -0
- package/module/song_url.js +26 -0
- package/module/song_url_match.js +35 -0
- package/module/song_url_ncmget.js +75 -0
- package/module/song_url_unblock.js +35 -0
- package/module/song_url_v1.js +54 -0
- package/module/song_wiki_summary.js +8 -0
- package/module/starpick_comments_summary.js +12 -0
- package/module/style_album.js +16 -0
- package/module/style_artist.js +16 -0
- package/module/style_detail.js +9 -0
- package/module/style_list.js +7 -0
- package/module/style_playlist.js +16 -0
- package/module/style_preference.js +11 -0
- package/module/style_song.js +12 -0
- package/module/summary_annual.js +12 -0
- package/module/threshold_detail_get.js +10 -0
- package/module/top_album.js +22 -0
- package/module/top_artists.js +11 -0
- package/module/top_list.js +20 -0
- package/module/top_mv.js +12 -0
- package/module/top_playlist.js +22 -0
- package/module/top_playlist_highquality.js +16 -0
- package/module/top_song.js +16 -0
- package/module/topic_detail.js +7 -0
- package/module/topic_detail_event_hot.js +7 -0
- package/module/topic_sublist.js +11 -0
- package/module/toplist.js +6 -0
- package/module/toplist_artist.js +12 -0
- package/module/toplist_detail.js +6 -0
- package/module/toplist_detail_v2.js +6 -0
- package/module/ugc_album_get.js +8 -0
- package/module/ugc_artist_get.js +8 -0
- package/module/ugc_artist_search.js +10 -0
- package/module/ugc_detail.js +17 -0
- package/module/ugc_mv_get.js +8 -0
- package/module/ugc_song_get.js +8 -0
- package/module/ugc_user_devote.js +6 -0
- package/module/user_account.js +5 -0
- package/module/user_audio.js +9 -0
- package/module/user_binding.js +9 -0
- package/module/user_bindingcellphone.js +15 -0
- package/module/user_cloud.js +10 -0
- package/module/user_cloud_del.js +9 -0
- package/module/user_cloud_detail.js +10 -0
- package/module/user_comment_history.js +15 -0
- package/module/user_detail.js +15 -0
- package/module/user_detail_new.js +20 -0
- package/module/user_dj.js +14 -0
- package/module/user_event.js +12 -0
- package/module/user_follow_mixed.js +23 -0
- package/module/user_followeds.js +17 -0
- package/module/user_follows.js +15 -0
- package/module/user_level.js +7 -0
- package/module/user_medal.js +11 -0
- package/module/user_mutualfollow_get.js +9 -0
- package/module/user_playlist.js +12 -0
- package/module/user_record.js +10 -0
- package/module/user_replacephone.js +14 -0
- package/module/user_social_status.js +11 -0
- package/module/user_social_status_edit.js +16 -0
- package/module/user_social_status_rcmd.js +5 -0
- package/module/user_social_status_support.js +5 -0
- package/module/user_subcount.js +6 -0
- package/module/user_update.js +15 -0
- package/module/verify_getQr.js +39 -0
- package/module/verify_qrcodestatus.js +12 -0
- package/module/video_category_list.js +15 -0
- package/module/video_detail.js +13 -0
- package/module/video_detail_info.js +14 -0
- package/module/video_group.js +16 -0
- package/module/video_group_list.js +11 -0
- package/module/video_sub.js +14 -0
- package/module/video_timeline_all.js +17 -0
- package/module/video_timeline_recommend.js +13 -0
- package/module/video_url.js +10 -0
- package/module/vip_growthpoint.js +11 -0
- package/module/vip_growthpoint_details.js +14 -0
- package/module/vip_growthpoint_get.js +13 -0
- package/module/vip_info.js +12 -0
- package/module/vip_info_v2.js +12 -0
- package/module/vip_tasks.js +11 -0
- package/module/vip_timemachine.js +17 -0
- package/module/voice_delete.js +7 -0
- package/module/voice_detail.js +7 -0
- package/module/voice_lyric.js +7 -0
- package/module/voice_upload.js +186 -0
- package/module/voicelist_detail.js +11 -0
- package/module/voicelist_list.js +13 -0
- package/module/voicelist_list_search.js +14 -0
- package/module/voicelist_search.js +14 -0
- package/module/voicelist_trans.js +15 -0
- package/module/weblog.js +10 -0
- package/module/yunbei.js +6 -0
- package/module/yunbei_expense.js +8 -0
- package/module/yunbei_info.js +5 -0
- package/module/yunbei_rcmd_song.js +17 -0
- package/module/yunbei_rcmd_song_history.js +16 -0
- package/module/yunbei_receipt.js +8 -0
- package/module/yunbei_sign.js +5 -0
- package/module/yunbei_task_finish.js +12 -0
- package/module/yunbei_tasks.js +9 -0
- package/module/yunbei_tasks_todo.js +9 -0
- package/module/yunbei_today.js +5 -0
- package/package.json +104 -0
- package/plugins/songUpload.js +61 -0
- package/plugins/upload.js +37 -0
- package/public/api.html +127 -0
- package/public/audio_match_demo/afp.js +1627 -0
- package/public/audio_match_demo/afp.wasm.js +5 -0
- package/public/audio_match_demo/index.html +199 -0
- package/public/audio_match_demo/rec.js +49 -0
- package/public/avatar_update.html +73 -0
- package/public/cloud.html +104 -0
- package/public/docs/.nojekyll +0 -0
- package/public/docs/_coverpage.md +13 -0
- package/public/docs/favicon.ico +0 -0
- package/public/docs/home.md +4857 -0
- package/public/docs/icon.png +0 -0
- package/public/docs/index.html +47 -0
- package/public/docs/ncmapireborn.png +0 -0
- package/public/docs/sw.js +90 -0
- package/public/eapi_decrypt.html +77 -0
- package/public/home.html +41 -0
- package/public/index.html +313 -0
- package/public/listen_together_host.html +324 -0
- package/public/login.html +47 -0
- package/public/playlist_cover_update.html +77 -0
- package/public/playlist_import.html +262 -0
- package/public/qrlogin-nocookie.html +72 -0
- package/public/qrlogin.html +71 -0
- package/public/static/docs.png +0 -0
- package/public/static/eapi_params.png +0 -0
- package/public/static/eapi_response.png +0 -0
- package/public/static/screenshot1.png +0 -0
- package/public/unblock_test.html +123 -0
- package/public/voice_upload.html +128 -0
- package/server.js +366 -0
- package/util/apicache.js +833 -0
- package/util/client-sign.js +169 -0
- package/util/config.json +20 -0
- package/util/crypto.js +135 -0
- package/util/index.js +159 -0
- package/util/logger.js +29 -0
- package/util/memory-cache.js +71 -0
- package/util/option.js +14 -0
- package/util/request.js +364 -0
|
@@ -0,0 +1,1627 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const WASM_BINARY_PLACEHOLDER = 'WASM_BINARY_PLACEHOLDER';
|
|
3
|
+
const logger = require('../../util/logger.js')
|
|
4
|
+
// See https://github.com/Distributive-Network/PythonMonkey/issues/266
|
|
5
|
+
if (typeof globalThis.setInterval != 'function'){
|
|
6
|
+
globalThis.setInterval = function pm$$setInterval(fn, timeout) {
|
|
7
|
+
const timerHnd = { cancel: false };
|
|
8
|
+
function fnWrapper()
|
|
9
|
+
{
|
|
10
|
+
if (timerHnd.cancel)
|
|
11
|
+
return;
|
|
12
|
+
setTimeout(fnWrapper, timeout);
|
|
13
|
+
fn();
|
|
14
|
+
}
|
|
15
|
+
timerHnd.id = setTimeout(fnWrapper, timeout);
|
|
16
|
+
return timerHnd;
|
|
17
|
+
}
|
|
18
|
+
globalThis.clearInterval = function pm$$clearInterval(timerHnd) {
|
|
19
|
+
timerHnd.clear = true;
|
|
20
|
+
clearTimeout(timerHnd.id);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
globalThis.b64decode = function b64decode(data) {
|
|
24
|
+
return Uint8Array.from(atob(data), c => c.charCodeAt(0));
|
|
25
|
+
}
|
|
26
|
+
globalThis.b64encode = function b64encode(data) {
|
|
27
|
+
return btoa(String.fromCharCode(...data));
|
|
28
|
+
}
|
|
29
|
+
// https://fn.music.163.com/g/chrome-extension-home-page-beta/
|
|
30
|
+
let AudioFingerprintRuntime = (() => {
|
|
31
|
+
var n, o = void 0 !== o ? o : {},i = {};
|
|
32
|
+
for (n in o)
|
|
33
|
+
o.hasOwnProperty(n) && (i[n] = o[n]);
|
|
34
|
+
var read_, readSync, readBinary, c, f, l = [],
|
|
35
|
+
p = "./this.program",
|
|
36
|
+
readSync = function(t, e, r) {
|
|
37
|
+
switch (t) {
|
|
38
|
+
case WASM_BINARY_PLACEHOLDER:
|
|
39
|
+
if (typeof WASM_BINARY == 'undefined') {
|
|
40
|
+
const { WASM_BINARY } = require('./afp.wasm.js');
|
|
41
|
+
e(globalThis.b64decode(WASM_BINARY));
|
|
42
|
+
} else {
|
|
43
|
+
e(globalThis.b64decode(WASM_BINARY));
|
|
44
|
+
}
|
|
45
|
+
default:
|
|
46
|
+
throw "Reading " + t + " is not supported";
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var v = o.print || console.log.bind(console),
|
|
51
|
+
g = o.printErr || console.warn.bind(console);
|
|
52
|
+
for (n in i)
|
|
53
|
+
i.hasOwnProperty(n) && (o[n] = i[n]);
|
|
54
|
+
i = null,
|
|
55
|
+
o.arguments && (l = o.arguments),
|
|
56
|
+
o.thisProgram && (p = o.thisProgram),
|
|
57
|
+
o.quit && o.quit;
|
|
58
|
+
var w;
|
|
59
|
+
o.wasmBinary && (w = o.wasmBinary);
|
|
60
|
+
var b, _ = o.noExitRuntime || !0;
|
|
61
|
+
"object" != typeof WebAssembly && abort("no native wasm support detected");
|
|
62
|
+
var C = !1;
|
|
63
|
+
|
|
64
|
+
function T(t, e) {
|
|
65
|
+
t || abort("Assertion failed: " + e)
|
|
66
|
+
}
|
|
67
|
+
var UTF8Decoder = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
|
|
68
|
+
|
|
69
|
+
function UTF8ArrayToString(heap, idx, maxBytesToRead) {
|
|
70
|
+
var endIdx = idx + maxBytesToRead;
|
|
71
|
+
var endPtr = idx;
|
|
72
|
+
while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
|
|
73
|
+
if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
|
|
74
|
+
return UTF8Decoder.decode(heap.subarray(idx, endPtr))
|
|
75
|
+
} else {
|
|
76
|
+
var str = "";
|
|
77
|
+
while (idx < endPtr) {
|
|
78
|
+
var u0 = heap[idx++];
|
|
79
|
+
if (!(u0 & 128)) {
|
|
80
|
+
str += String.fromCharCode(u0);
|
|
81
|
+
continue
|
|
82
|
+
}
|
|
83
|
+
var u1 = heap[idx++] & 63;
|
|
84
|
+
if ((u0 & 224) == 192) {
|
|
85
|
+
str += String.fromCharCode((u0 & 31) << 6 | u1);
|
|
86
|
+
continue
|
|
87
|
+
}
|
|
88
|
+
var u2 = heap[idx++] & 63;
|
|
89
|
+
if ((u0 & 240) == 224) {
|
|
90
|
+
u0 = (u0 & 15) << 12 | u1 << 6 | u2
|
|
91
|
+
} else {
|
|
92
|
+
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63
|
|
93
|
+
}
|
|
94
|
+
if (u0 < 65536) {
|
|
95
|
+
str += String.fromCharCode(u0)
|
|
96
|
+
} else {
|
|
97
|
+
var ch = u0 - 65536;
|
|
98
|
+
str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return str
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function UTF8ToString(ptr, maxBytesToRead) {
|
|
106
|
+
return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""
|
|
107
|
+
}
|
|
108
|
+
function UTF8ToString(t, e) {
|
|
109
|
+
return t ? UTF8ArrayToString(O, t, e) : ""
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
|
|
114
|
+
if (!(maxBytesToWrite > 0)) return 0;
|
|
115
|
+
var startIdx = outIdx;
|
|
116
|
+
var endIdx = outIdx + maxBytesToWrite - 1;
|
|
117
|
+
for (var i = 0; i < str.length; ++i) {
|
|
118
|
+
var u = str.charCodeAt(i);
|
|
119
|
+
if (u >= 55296 && u <= 57343) {
|
|
120
|
+
var u1 = str.charCodeAt(++i);
|
|
121
|
+
u = 65536 + ((u & 1023) << 10) | u1 & 1023
|
|
122
|
+
}
|
|
123
|
+
if (u <= 127) {
|
|
124
|
+
if (outIdx >= endIdx) break;
|
|
125
|
+
heap[outIdx++] = u
|
|
126
|
+
} else if (u <= 2047) {
|
|
127
|
+
if (outIdx + 1 >= endIdx) break;
|
|
128
|
+
heap[outIdx++] = 192 | u >> 6;
|
|
129
|
+
heap[outIdx++] = 128 | u & 63
|
|
130
|
+
} else if (u <= 65535) {
|
|
131
|
+
if (outIdx + 2 >= endIdx) break;
|
|
132
|
+
heap[outIdx++] = 224 | u >> 12;
|
|
133
|
+
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
134
|
+
heap[outIdx++] = 128 | u & 63
|
|
135
|
+
} else {
|
|
136
|
+
if (outIdx + 3 >= endIdx) break;
|
|
137
|
+
heap[outIdx++] = 240 | u >> 18;
|
|
138
|
+
heap[outIdx++] = 128 | u >> 12 & 63;
|
|
139
|
+
heap[outIdx++] = 128 | u >> 6 & 63;
|
|
140
|
+
heap[outIdx++] = 128 | u & 63
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
heap[outIdx] = 0;
|
|
144
|
+
return outIdx - startIdx
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
function UTF8CharCount(t) {
|
|
149
|
+
for (var e = 0, r = 0; r < t.length; ++r) {
|
|
150
|
+
var n = t.charCodeAt(r);
|
|
151
|
+
n >= 55296 && n <= 57343 && (n = 65536 + ((1023 & n) << 10) | 1023 & t.charCodeAt(++r)),
|
|
152
|
+
n <= 127 ? ++e : e += n <= 2047 ? 2 : n <= 65535 ? 3 : 4
|
|
153
|
+
}
|
|
154
|
+
return e
|
|
155
|
+
}
|
|
156
|
+
var E, S, O, k, W, j, R, M, I, UTF16Decoder = "undefined" != typeof TextDecoder ? new TextDecoder("utf-16le") : void 0;
|
|
157
|
+
|
|
158
|
+
function UTF16ArrayToString(t, e) {
|
|
159
|
+
for (var r = t, n = r >> 1, o = n + e / 2; !(n >= o) && W[n];)
|
|
160
|
+
++n;
|
|
161
|
+
if ((r = n << 1) - t > 32 && UTF16Decoder)
|
|
162
|
+
return UTF16Decoder.decode(O.subarray(t, r));
|
|
163
|
+
for (var i = "", a = 0; !(a >= e / 2); ++a) {
|
|
164
|
+
var u = k[t + 2 * a >> 1];
|
|
165
|
+
if (0 == u)
|
|
166
|
+
break;
|
|
167
|
+
i += String.fromCharCode(u)
|
|
168
|
+
}
|
|
169
|
+
return i
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function H(t, e, r) {
|
|
173
|
+
if (void 0 === r && (r = 2147483647),
|
|
174
|
+
r < 2)
|
|
175
|
+
return 0;
|
|
176
|
+
for (var n = e, o = (r -= 2) < 2 * t.length ? r / 2 : t.length, i = 0; i < o; ++i) {
|
|
177
|
+
var a = t.charCodeAt(i);
|
|
178
|
+
k[e >> 1] = a,
|
|
179
|
+
e += 2
|
|
180
|
+
}
|
|
181
|
+
return k[e >> 1] = 0,
|
|
182
|
+
e - n
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function Y(t) {
|
|
186
|
+
return 2 * t.length
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function V(t, e) {
|
|
190
|
+
for (var r = 0, n = ""; !(r >= e / 4);) {
|
|
191
|
+
var o = j[t + 4 * r >> 2];
|
|
192
|
+
if (0 == o)
|
|
193
|
+
break;
|
|
194
|
+
if (++r,
|
|
195
|
+
o >= 65536) {
|
|
196
|
+
var i = o - 65536;
|
|
197
|
+
n += String.fromCharCode(55296 | i >> 10, 56320 | 1023 & i)
|
|
198
|
+
} else
|
|
199
|
+
n += String.fromCharCode(o)
|
|
200
|
+
}
|
|
201
|
+
return n
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function z(t, e, r) {
|
|
205
|
+
if (void 0 === r && (r = 2147483647),
|
|
206
|
+
r < 4)
|
|
207
|
+
return 0;
|
|
208
|
+
for (var n = e, o = n + r - 4, i = 0; i < t.length; ++i) {
|
|
209
|
+
var a = t.charCodeAt(i);
|
|
210
|
+
if (a >= 55296 && a <= 57343)
|
|
211
|
+
a = 65536 + ((1023 & a) << 10) | 1023 & t.charCodeAt(++i);
|
|
212
|
+
if (j[e >> 2] = a,
|
|
213
|
+
(e += 4) + 4 > o)
|
|
214
|
+
break
|
|
215
|
+
}
|
|
216
|
+
return j[e >> 2] = 0,
|
|
217
|
+
e - n
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function B(t) {
|
|
221
|
+
for (var e = 0, r = 0; r < t.length; ++r) {
|
|
222
|
+
var n = t.charCodeAt(r);
|
|
223
|
+
n >= 55296 && n <= 57343 && ++r,
|
|
224
|
+
e += 4
|
|
225
|
+
}
|
|
226
|
+
return e
|
|
227
|
+
}
|
|
228
|
+
o.INITIAL_MEMORY;
|
|
229
|
+
var L, G = [],
|
|
230
|
+
N = [],
|
|
231
|
+
q = [];
|
|
232
|
+
var J = 0,
|
|
233
|
+
X = null,
|
|
234
|
+
Z = null;
|
|
235
|
+
|
|
236
|
+
function abort(what) {
|
|
237
|
+
throw o.onAbort && o.onAbort(what),
|
|
238
|
+
g(what = "Aborted(" + what + ")"),
|
|
239
|
+
C = !0,
|
|
240
|
+
1,
|
|
241
|
+
what += ". Build with -s ASSERTIONS=1 for more info.",
|
|
242
|
+
new WebAssembly.RuntimeError(what)
|
|
243
|
+
}
|
|
244
|
+
o.preloadedImages = {},
|
|
245
|
+
o.preloadedAudios = {};
|
|
246
|
+
var Q;
|
|
247
|
+
|
|
248
|
+
function isDataURI(t) {
|
|
249
|
+
return t.startsWith("data:application/octet-stream;base64,")
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
function isFileURI(t) {
|
|
253
|
+
return t.startsWith("file://")
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function getBinary(file) {
|
|
257
|
+
try {
|
|
258
|
+
if (file == Q && w)
|
|
259
|
+
return new Uint8Array(w);
|
|
260
|
+
if (readBinary)
|
|
261
|
+
return readBinary(file);
|
|
262
|
+
throw "both async and sync fetching of the wasm failed"
|
|
263
|
+
} catch (t) {
|
|
264
|
+
abort(t)
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function callRuntimeCallbacks(cb) {
|
|
269
|
+
for (; cb.length > 0;) {
|
|
270
|
+
var func = cb.shift();
|
|
271
|
+
if ("function" != typeof func) {
|
|
272
|
+
var r = func.func;
|
|
273
|
+
"number" == typeof r ? void 0 === func.arg ? it(r)() : it(r)(func.arg) : r(void 0 === func.arg ? null : func.arg)
|
|
274
|
+
} else
|
|
275
|
+
func(o)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
var wasmBinaryFile = WASM_BINARY_PLACEHOLDER;
|
|
279
|
+
isDataURI(wasmBinaryFile) || (Q = function(t) {
|
|
280
|
+
return wasmBinaryFile
|
|
281
|
+
}(Q));
|
|
282
|
+
var ot = [];
|
|
283
|
+
|
|
284
|
+
function it(t) {
|
|
285
|
+
var e = ot[t];
|
|
286
|
+
return e || (t >= ot.length && (ot.length = t + 1),
|
|
287
|
+
ot[t] = e = L.get(t)),
|
|
288
|
+
e
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function ExceptionInfo(excPtr) {
|
|
292
|
+
this.excPtr = excPtr,
|
|
293
|
+
this.ptr = excPtr - 16,
|
|
294
|
+
this.set_type = function(t) {
|
|
295
|
+
j[this.ptr + 4 >> 2] = t
|
|
296
|
+
},
|
|
297
|
+
this.get_type = function() {
|
|
298
|
+
return j[this.ptr + 4 >> 2]
|
|
299
|
+
},
|
|
300
|
+
this.set_destructor = function(t) {
|
|
301
|
+
j[this.ptr + 8 >> 2] = t
|
|
302
|
+
},
|
|
303
|
+
this.get_destructor = function() {
|
|
304
|
+
return j[this.ptr + 8 >> 2]
|
|
305
|
+
},
|
|
306
|
+
this.set_refcount = function(t) {
|
|
307
|
+
j[this.ptr >> 2] = t
|
|
308
|
+
},
|
|
309
|
+
this.set_caught = function(t) {
|
|
310
|
+
t = t ? 1 : 0,
|
|
311
|
+
S[this.ptr + 12 >> 0] = t
|
|
312
|
+
},
|
|
313
|
+
this.get_caught = function() {
|
|
314
|
+
return 0 != S[this.ptr + 12 >> 0]
|
|
315
|
+
},
|
|
316
|
+
this.set_rethrown = function(t) {
|
|
317
|
+
t = t ? 1 : 0,
|
|
318
|
+
S[this.ptr + 13 >> 0] = t
|
|
319
|
+
},
|
|
320
|
+
this.get_rethrown = function() {
|
|
321
|
+
return 0 != S[this.ptr + 13 >> 0]
|
|
322
|
+
},
|
|
323
|
+
this.init = function(t, e) {
|
|
324
|
+
this.set_type(t),
|
|
325
|
+
this.set_destructor(e),
|
|
326
|
+
this.set_refcount(0),
|
|
327
|
+
this.set_caught(!1),
|
|
328
|
+
this.set_rethrown(!1)
|
|
329
|
+
},
|
|
330
|
+
this.add_ref = function() {
|
|
331
|
+
var t = j[this.ptr >> 2];
|
|
332
|
+
j[this.ptr >> 2] = t + 1
|
|
333
|
+
},
|
|
334
|
+
this.release_ref = function() {
|
|
335
|
+
var t = j[this.ptr >> 2];
|
|
336
|
+
return j[this.ptr >> 2] = t - 1,
|
|
337
|
+
1 === t
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function ut(t) {
|
|
342
|
+
switch (t) {
|
|
343
|
+
case 1:
|
|
344
|
+
return 0;
|
|
345
|
+
case 2:
|
|
346
|
+
return 1;
|
|
347
|
+
case 4:
|
|
348
|
+
return 2;
|
|
349
|
+
case 8:
|
|
350
|
+
return 3;
|
|
351
|
+
default:
|
|
352
|
+
throw new TypeError("Unknown type size: " + t)
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
var st = void 0;
|
|
356
|
+
|
|
357
|
+
function ct(t) {
|
|
358
|
+
for (var e = "", r = t; O[r];)
|
|
359
|
+
e += st[O[r++]];
|
|
360
|
+
return e
|
|
361
|
+
}
|
|
362
|
+
var ft = {},
|
|
363
|
+
lt = {},
|
|
364
|
+
pt = {};
|
|
365
|
+
|
|
366
|
+
function dt(t) {
|
|
367
|
+
if (void 0 === t)
|
|
368
|
+
return "_unknown";
|
|
369
|
+
var e = (t = t.replace(/[^a-zA-Z0-9_]/g, "$")).charCodeAt(0);
|
|
370
|
+
return e >= 48 && e <= 57 ? "_" + t : t
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function ht(t, e) {
|
|
374
|
+
return t = dt(t),
|
|
375
|
+
new Function("body", "return function " + t + '() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function yt(t, e) {
|
|
379
|
+
var r = ht(e, (function(t) {
|
|
380
|
+
this.name = e,
|
|
381
|
+
this.message = t;
|
|
382
|
+
var r = new Error(t).stack;
|
|
383
|
+
void 0 !== r && (this.stack = this.toString() + "\n" + r.replace(/^Error(:[^\n]*)?\n/, ""))
|
|
384
|
+
}));
|
|
385
|
+
return r.prototype = Object.create(t.prototype),
|
|
386
|
+
r.prototype.constructor = r,
|
|
387
|
+
r.prototype.toString = function() {
|
|
388
|
+
return void 0 === this.message ? this.name : this.name + ": " + this.message
|
|
389
|
+
},
|
|
390
|
+
r
|
|
391
|
+
}
|
|
392
|
+
var mt = void 0;
|
|
393
|
+
|
|
394
|
+
function vt(t) {
|
|
395
|
+
throw new mt(t)
|
|
396
|
+
}
|
|
397
|
+
var gt = void 0;
|
|
398
|
+
|
|
399
|
+
function wt(t) {
|
|
400
|
+
throw new gt(t)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function bt(t, e, r) {
|
|
404
|
+
function n(e) {
|
|
405
|
+
var n = r(e);
|
|
406
|
+
n.length !== t.length && wt("Mismatched type converter count");
|
|
407
|
+
for (var o = 0; o < t.length; ++o)
|
|
408
|
+
_t(t[o], n[o])
|
|
409
|
+
}
|
|
410
|
+
t.forEach((function(t) {
|
|
411
|
+
pt[t] = e
|
|
412
|
+
}));
|
|
413
|
+
var o = new Array(e.length),
|
|
414
|
+
i = [],
|
|
415
|
+
a = 0;
|
|
416
|
+
e.forEach((function(t, e) {
|
|
417
|
+
lt.hasOwnProperty(t) ? o[e] = lt[t] : (i.push(t),
|
|
418
|
+
ft.hasOwnProperty(t) || (ft[t] = []),
|
|
419
|
+
ft[t].push((function() {
|
|
420
|
+
o[e] = lt[t],
|
|
421
|
+
++a === i.length && n(o)
|
|
422
|
+
})))
|
|
423
|
+
})),
|
|
424
|
+
0 === i.length && n(o)
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function _t(t, e, r) {
|
|
428
|
+
if (r = r || {},
|
|
429
|
+
!("argPackAdvance" in e))
|
|
430
|
+
throw new TypeError("registerType registeredInstance requires argPackAdvance");
|
|
431
|
+
var n = e.name;
|
|
432
|
+
if (t || vt('type "' + n + '" must have a positive integer typeid pointer'),
|
|
433
|
+
lt.hasOwnProperty(t)) {
|
|
434
|
+
if (r.ignoreDuplicateRegistrations)
|
|
435
|
+
return;
|
|
436
|
+
vt("Cannot register type '" + n + "' twice")
|
|
437
|
+
}
|
|
438
|
+
if (lt[t] = e,
|
|
439
|
+
delete pt[t],
|
|
440
|
+
ft.hasOwnProperty(t)) {
|
|
441
|
+
var o = ft[t];
|
|
442
|
+
delete ft[t],
|
|
443
|
+
o.forEach((function(t) {
|
|
444
|
+
t()
|
|
445
|
+
}))
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function Ct(t) {
|
|
450
|
+
if (!(this instanceof Rt))
|
|
451
|
+
return !1;
|
|
452
|
+
if (!(t instanceof Rt))
|
|
453
|
+
return !1;
|
|
454
|
+
for (var e = this.$$.ptrType.registeredClass, r = this.$$.ptr, n = t.$$.ptrType.registeredClass, o = t.$$.ptr; e.baseClass;)
|
|
455
|
+
r = e.upcast(r),
|
|
456
|
+
e = e.baseClass;
|
|
457
|
+
for (; n.baseClass;)
|
|
458
|
+
o = n.upcast(o),
|
|
459
|
+
n = n.baseClass;
|
|
460
|
+
return e === n && r === o
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function Tt(t) {
|
|
464
|
+
vt(t.$$.ptrType.registeredClass.name + " instance already deleted")
|
|
465
|
+
}
|
|
466
|
+
var $t = !1;
|
|
467
|
+
|
|
468
|
+
function Pt(t) {}
|
|
469
|
+
|
|
470
|
+
function At(t) {
|
|
471
|
+
t.count.value -= 1,
|
|
472
|
+
0 === t.count.value && function(t) {
|
|
473
|
+
t.smartPtr ? t.smartPtrType.rawDestructor(t.smartPtr) : t.ptrType.registeredClass.rawDestructor(t.ptr)
|
|
474
|
+
}(t)
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function Dt(t) {
|
|
478
|
+
return "undefined" == typeof FinalizationRegistry ? (Dt = function(t) {
|
|
479
|
+
return t
|
|
480
|
+
},
|
|
481
|
+
t) : ($t = new FinalizationRegistry((function(t) {
|
|
482
|
+
At(t.$$)
|
|
483
|
+
})),
|
|
484
|
+
Dt = function(t) {
|
|
485
|
+
var e = {
|
|
486
|
+
$$: t.$$
|
|
487
|
+
};
|
|
488
|
+
return $t.register(t, e, t),
|
|
489
|
+
t
|
|
490
|
+
},
|
|
491
|
+
Pt = function(t) {
|
|
492
|
+
$t.unregister(t)
|
|
493
|
+
},
|
|
494
|
+
Dt(t))
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
function Ft() {
|
|
498
|
+
if (this.$$.ptr || Tt(this),
|
|
499
|
+
this.$$.preservePointerOnDelete)
|
|
500
|
+
return this.$$.count.value += 1,
|
|
501
|
+
this;
|
|
502
|
+
var t, e = Dt(Object.create(Object.getPrototypeOf(this), {
|
|
503
|
+
$$: {
|
|
504
|
+
value: (t = this.$$, {
|
|
505
|
+
count: t.count,
|
|
506
|
+
deleteScheduled: t.deleteScheduled,
|
|
507
|
+
preservePointerOnDelete: t.preservePointerOnDelete,
|
|
508
|
+
ptr: t.ptr,
|
|
509
|
+
ptrType: t.ptrType,
|
|
510
|
+
smartPtr: t.smartPtr,
|
|
511
|
+
smartPtrType: t.smartPtrType
|
|
512
|
+
})
|
|
513
|
+
}
|
|
514
|
+
}));
|
|
515
|
+
return e.$$.count.value += 1,
|
|
516
|
+
e.$$.deleteScheduled = !1,
|
|
517
|
+
e
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function Et() {
|
|
521
|
+
this.$$.ptr || Tt(this),
|
|
522
|
+
this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && vt("Object already scheduled for deletion"),
|
|
523
|
+
Pt(this),
|
|
524
|
+
At(this.$$),
|
|
525
|
+
this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0,
|
|
526
|
+
this.$$.ptr = void 0)
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function St() {
|
|
530
|
+
return !this.$$.ptr
|
|
531
|
+
}
|
|
532
|
+
var Ot = void 0,
|
|
533
|
+
kt = [];
|
|
534
|
+
|
|
535
|
+
function Wt() {
|
|
536
|
+
for (; kt.length;) {
|
|
537
|
+
var t = kt.pop();
|
|
538
|
+
t.$$.deleteScheduled = !1,
|
|
539
|
+
t.delete()
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function jt() {
|
|
544
|
+
return this.$$.ptr || Tt(this),
|
|
545
|
+
this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && vt("Object already scheduled for deletion"),
|
|
546
|
+
kt.push(this),
|
|
547
|
+
1 === kt.length && Ot && Ot(Wt),
|
|
548
|
+
this.$$.deleteScheduled = !0,
|
|
549
|
+
this
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function Rt() {}
|
|
553
|
+
var Mt = {};
|
|
554
|
+
|
|
555
|
+
function It(t, e, r) {
|
|
556
|
+
if (void 0 === t[e].overloadTable) {
|
|
557
|
+
var n = t[e];
|
|
558
|
+
t[e] = function() {
|
|
559
|
+
return t[e].overloadTable.hasOwnProperty(arguments.length) || vt("Function '" + r + "' called with an invalid number of arguments (" + arguments.length + ") - expects one of (" + t[e].overloadTable + ")!"),
|
|
560
|
+
t[e].overloadTable[arguments.length].apply(this, arguments)
|
|
561
|
+
},
|
|
562
|
+
t[e].overloadTable = [],
|
|
563
|
+
t[e].overloadTable[n.argCount] = n
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function xt(t, e, r) {
|
|
568
|
+
o.hasOwnProperty(t) ? ((void 0 === r || void 0 !== o[t].overloadTable && void 0 !== o[t].overloadTable[r]) && vt("Cannot register public name '" + t + "' twice"),
|
|
569
|
+
It(o, t, t),
|
|
570
|
+
o.hasOwnProperty(r) && vt("Cannot register multiple overloads of a function with the same number of arguments (" + r + ")!"),
|
|
571
|
+
o[t].overloadTable[r] = e) : (o[t] = e,
|
|
572
|
+
void 0 !== r && (o[t].numArguments = r))
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
function Ut(t, e, r, n, o, i, a, u) {
|
|
576
|
+
this.name = t,
|
|
577
|
+
this.constructor = e,
|
|
578
|
+
this.instancePrototype = r,
|
|
579
|
+
this.rawDestructor = n,
|
|
580
|
+
this.baseClass = o,
|
|
581
|
+
this.getActualType = i,
|
|
582
|
+
this.upcast = a,
|
|
583
|
+
this.downcast = u,
|
|
584
|
+
this.pureVirtualFunctions = []
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
function Ht(t, e, r) {
|
|
588
|
+
for (; e !== r;)
|
|
589
|
+
e.upcast || vt("Expected null or instance of " + r.name + ", got an instance of " + e.name),
|
|
590
|
+
t = e.upcast(t),
|
|
591
|
+
e = e.baseClass;
|
|
592
|
+
return t
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function Yt(t, e) {
|
|
596
|
+
if (null === e)
|
|
597
|
+
return this.isReference && vt("null is not a valid " + this.name),
|
|
598
|
+
0;
|
|
599
|
+
e.$$ || vt('Cannot pass "' + ge(e) + '" as a ' + this.name),
|
|
600
|
+
e.$$.ptr || vt("Cannot pass deleted object as a pointer of type " + this.name);
|
|
601
|
+
var r = e.$$.ptrType.registeredClass;
|
|
602
|
+
return Ht(e.$$.ptr, r, this.registeredClass)
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function Vt(t, e) {
|
|
606
|
+
var r;
|
|
607
|
+
if (null === e)
|
|
608
|
+
return this.isReference && vt("null is not a valid " + this.name),
|
|
609
|
+
this.isSmartPointer ? (r = this.rawConstructor(),
|
|
610
|
+
null !== t && t.push(this.rawDestructor, r),
|
|
611
|
+
r) : 0;
|
|
612
|
+
e.$$ || vt('Cannot pass "' + ge(e) + '" as a ' + this.name),
|
|
613
|
+
e.$$.ptr || vt("Cannot pass deleted object as a pointer of type " + this.name),
|
|
614
|
+
!this.isConst && e.$$.ptrType.isConst && vt("Cannot convert argument of type " + (e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name) + " to parameter type " + this.name);
|
|
615
|
+
var n = e.$$.ptrType.registeredClass;
|
|
616
|
+
if (r = Ht(e.$$.ptr, n, this.registeredClass),
|
|
617
|
+
this.isSmartPointer)
|
|
618
|
+
switch (void 0 === e.$$.smartPtr && vt("Passing raw pointer to smart pointer is illegal"),
|
|
619
|
+
this.sharingPolicy) {
|
|
620
|
+
case 0:
|
|
621
|
+
e.$$.smartPtrType === this ? r = e.$$.smartPtr : vt("Cannot convert argument of type " + (e.$$.smartPtrType ? e.$$.smartPtrType.name : e.$$.ptrType.name) + " to parameter type " + this.name);
|
|
622
|
+
break;
|
|
623
|
+
case 1:
|
|
624
|
+
r = e.$$.smartPtr;
|
|
625
|
+
break;
|
|
626
|
+
case 2:
|
|
627
|
+
if (e.$$.smartPtrType === this)
|
|
628
|
+
r = e.$$.smartPtr;
|
|
629
|
+
else {
|
|
630
|
+
var o = e.clone();
|
|
631
|
+
r = this.rawShare(r, ve.toHandle((function() {
|
|
632
|
+
o.delete()
|
|
633
|
+
}))),
|
|
634
|
+
null !== t && t.push(this.rawDestructor, r)
|
|
635
|
+
}
|
|
636
|
+
break;
|
|
637
|
+
default:
|
|
638
|
+
vt("Unsupporting sharing policy")
|
|
639
|
+
}
|
|
640
|
+
return r
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
function zt(t, e) {
|
|
644
|
+
if (null === e)
|
|
645
|
+
return this.isReference && vt("null is not a valid " + this.name),
|
|
646
|
+
0;
|
|
647
|
+
e.$$ || vt('Cannot pass "' + ge(e) + '" as a ' + this.name),
|
|
648
|
+
e.$$.ptr || vt("Cannot pass deleted object as a pointer of type " + this.name),
|
|
649
|
+
e.$$.ptrType.isConst && vt("Cannot convert argument of type " + e.$$.ptrType.name + " to parameter type " + this.name);
|
|
650
|
+
var r = e.$$.ptrType.registeredClass;
|
|
651
|
+
return Ht(e.$$.ptr, r, this.registeredClass)
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function Bt(t) {
|
|
655
|
+
return this.fromWireType(R[t >> 2])
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function Lt(t) {
|
|
659
|
+
return this.rawGetPointee && (t = this.rawGetPointee(t)),
|
|
660
|
+
t
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function Gt(t) {
|
|
664
|
+
this.rawDestructor && this.rawDestructor(t)
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
function Nt(t) {
|
|
668
|
+
null !== t && t.delete()
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function qt(t, e, r) {
|
|
672
|
+
if (e === r)
|
|
673
|
+
return t;
|
|
674
|
+
if (void 0 === r.baseClass)
|
|
675
|
+
return null;
|
|
676
|
+
var n = qt(t, e, r.baseClass);
|
|
677
|
+
return null === n ? null : r.downcast(n)
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function Jt() {
|
|
681
|
+
return Object.keys(Kt).length
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
function Xt() {
|
|
685
|
+
var t = [];
|
|
686
|
+
for (var e in Kt)
|
|
687
|
+
Kt.hasOwnProperty(e) && t.push(Kt[e]);
|
|
688
|
+
return t
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function Zt(t) {
|
|
692
|
+
Ot = t,
|
|
693
|
+
kt.length && Ot && Ot(Wt)
|
|
694
|
+
}
|
|
695
|
+
var Kt = {};
|
|
696
|
+
|
|
697
|
+
function Qt(t, e) {
|
|
698
|
+
return e = function(t, e) {
|
|
699
|
+
for (void 0 === e && vt("ptr should not be undefined"); t.baseClass;)
|
|
700
|
+
e = t.upcast(e),
|
|
701
|
+
t = t.baseClass;
|
|
702
|
+
return e
|
|
703
|
+
}(t, e),
|
|
704
|
+
Kt[e]
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function te(t, e) {
|
|
708
|
+
return e.ptrType && e.ptr || wt("makeClassHandle requires ptr and ptrType"),
|
|
709
|
+
!!e.smartPtrType !== !!e.smartPtr && wt("Both smartPtrType and smartPtr must be specified"),
|
|
710
|
+
e.count = {
|
|
711
|
+
value: 1
|
|
712
|
+
},
|
|
713
|
+
Dt(Object.create(t, {
|
|
714
|
+
$$: {
|
|
715
|
+
value: e
|
|
716
|
+
}
|
|
717
|
+
}))
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function ee(t) {
|
|
721
|
+
var e = this.getPointee(t);
|
|
722
|
+
if (!e)
|
|
723
|
+
return this.destructor(t),
|
|
724
|
+
null;
|
|
725
|
+
var r = Qt(this.registeredClass, e);
|
|
726
|
+
if (void 0 !== r) {
|
|
727
|
+
if (0 === r.$$.count.value)
|
|
728
|
+
return r.$$.ptr = e,
|
|
729
|
+
r.$$.smartPtr = t,
|
|
730
|
+
r.clone();
|
|
731
|
+
var n = r.clone();
|
|
732
|
+
return this.destructor(t),
|
|
733
|
+
n
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
function o() {
|
|
737
|
+
return this.isSmartPointer ? te(this.registeredClass.instancePrototype, {
|
|
738
|
+
ptrType: this.pointeeType,
|
|
739
|
+
ptr: e,
|
|
740
|
+
smartPtrType: this,
|
|
741
|
+
smartPtr: t
|
|
742
|
+
}) : te(this.registeredClass.instancePrototype, {
|
|
743
|
+
ptrType: this,
|
|
744
|
+
ptr: t
|
|
745
|
+
})
|
|
746
|
+
}
|
|
747
|
+
var i, a = this.registeredClass.getActualType(e),
|
|
748
|
+
u = Mt[a];
|
|
749
|
+
if (!u)
|
|
750
|
+
return o.call(this);
|
|
751
|
+
i = this.isConst ? u.constPointerType : u.pointerType;
|
|
752
|
+
var s = qt(e, this.registeredClass, i.registeredClass);
|
|
753
|
+
return null === s ? o.call(this) : this.isSmartPointer ? te(i.registeredClass.instancePrototype, {
|
|
754
|
+
ptrType: i,
|
|
755
|
+
ptr: s,
|
|
756
|
+
smartPtrType: this,
|
|
757
|
+
smartPtr: t
|
|
758
|
+
}) : te(i.registeredClass.instancePrototype, {
|
|
759
|
+
ptrType: i,
|
|
760
|
+
ptr: s
|
|
761
|
+
})
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
function re(t, e, r, n, o, i, a, u, s, c, f) {
|
|
765
|
+
this.name = t,
|
|
766
|
+
this.registeredClass = e,
|
|
767
|
+
this.isReference = r,
|
|
768
|
+
this.isConst = n,
|
|
769
|
+
this.isSmartPointer = o,
|
|
770
|
+
this.pointeeType = i,
|
|
771
|
+
this.sharingPolicy = a,
|
|
772
|
+
this.rawGetPointee = u,
|
|
773
|
+
this.rawConstructor = s,
|
|
774
|
+
this.rawShare = c,
|
|
775
|
+
this.rawDestructor = f,
|
|
776
|
+
o || void 0 !== e.baseClass ? this.toWireType = Vt : n ? (this.toWireType = Yt,
|
|
777
|
+
this.destructorFunction = null) : (this.toWireType = zt,
|
|
778
|
+
this.destructorFunction = null)
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
function ne(t, e, r) {
|
|
782
|
+
o.hasOwnProperty(t) || wt("Replacing nonexistant public symbol"),
|
|
783
|
+
void 0 !== o[t].overloadTable && void 0 !== r ? o[t].overloadTable[r] = e : (o[t] = e,
|
|
784
|
+
o[t].argCount = r)
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function oe(t, e, r) {
|
|
788
|
+
return t.includes("j") ? function(t, e, r) {
|
|
789
|
+
var n = o["dynCall_" + t];
|
|
790
|
+
return r && r.length ? n.apply(null, [e].concat(r)) : n.call(null, e)
|
|
791
|
+
}(t, e, r) : it(e).apply(null, r)
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
function ie(t, e) {
|
|
795
|
+
var r, n, o, i = (t = ct(t)).includes("j") ? (r = t,
|
|
796
|
+
n = e,
|
|
797
|
+
o = [],
|
|
798
|
+
function() {
|
|
799
|
+
o.length = arguments.length;
|
|
800
|
+
for (var t = 0; t < arguments.length; t++)
|
|
801
|
+
o[t] = arguments[t];
|
|
802
|
+
return oe(r, n, o)
|
|
803
|
+
}
|
|
804
|
+
) : it(e);
|
|
805
|
+
return "function" != typeof i && vt("unknown function pointer with signature " + t + ": " + e),
|
|
806
|
+
i
|
|
807
|
+
}
|
|
808
|
+
var ae = void 0;
|
|
809
|
+
|
|
810
|
+
function ue(t) {
|
|
811
|
+
var e = je(t),
|
|
812
|
+
r = ct(e);
|
|
813
|
+
return We(e),
|
|
814
|
+
r
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
function se(t, e) {
|
|
818
|
+
var r = [],
|
|
819
|
+
n = {};
|
|
820
|
+
throw e.forEach((function t(e) {
|
|
821
|
+
n[e] || lt[e] || (pt[e] ? pt[e].forEach(t) : (r.push(e),
|
|
822
|
+
n[e] = !0))
|
|
823
|
+
})),
|
|
824
|
+
new ae(t + ": " + r.map(ue).join([", "]))
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
function ce(t, e) {
|
|
828
|
+
for (var r = [], n = 0; n < t; n++)
|
|
829
|
+
r.push(j[(e >> 2) + n]);
|
|
830
|
+
return r
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
function fe(t) {
|
|
834
|
+
for (; t.length;) {
|
|
835
|
+
var e = t.pop();
|
|
836
|
+
t.pop()(e)
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function le(t, e, r, n, o) {
|
|
841
|
+
var i = e.length;
|
|
842
|
+
i < 2 && vt("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
843
|
+
for (var a = null !== e[1] && null !== r, u = !1, s = 1; s < e.length; ++s)
|
|
844
|
+
if (null !== e[s] && void 0 === e[s].destructorFunction) {
|
|
845
|
+
u = !0;
|
|
846
|
+
break
|
|
847
|
+
}
|
|
848
|
+
var c = "void" !== e[0].name,
|
|
849
|
+
f = "",
|
|
850
|
+
l = "";
|
|
851
|
+
for (s = 0; s < i - 2; ++s)
|
|
852
|
+
f += (0 !== s ? ", " : "") + "arg" + s,
|
|
853
|
+
l += (0 !== s ? ", " : "") + "arg" + s + "Wired";
|
|
854
|
+
var p = "return function " + dt(t) + "(" + f + ") {\nif (arguments.length !== " + (i - 2) + ") {\nthrowBindingError('function " + t + " called with ' + arguments.length + ' arguments, expected " + (i - 2) + " args!');\n}\n";
|
|
855
|
+
u && (p += "var destructors = [];\n");
|
|
856
|
+
var d = u ? "destructors" : "null",
|
|
857
|
+
h = ["throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"],
|
|
858
|
+
y = [vt, n, o, fe, e[0], e[1]];
|
|
859
|
+
a && (p += "var thisWired = classParam.toWireType(" + d + ", this);\n");
|
|
860
|
+
for (s = 0; s < i - 2; ++s)
|
|
861
|
+
p += "var arg" + s + "Wired = argType" + s + ".toWireType(" + d + ", arg" + s + "); // " + e[s + 2].name + "\n",
|
|
862
|
+
h.push("argType" + s),
|
|
863
|
+
y.push(e[s + 2]);
|
|
864
|
+
if (a && (l = "thisWired" + (l.length > 0 ? ", " : "") + l),
|
|
865
|
+
p += (c ? "var rv = " : "") + "invoker(fn" + (l.length > 0 ? ", " : "") + l + ");\n",
|
|
866
|
+
u)
|
|
867
|
+
p += "runDestructors(destructors);\n";
|
|
868
|
+
else
|
|
869
|
+
for (s = a ? 1 : 2; s < e.length; ++s) {
|
|
870
|
+
var m = 1 === s ? "thisWired" : "arg" + (s - 2) + "Wired";
|
|
871
|
+
null !== e[s].destructorFunction && (p += m + "_dtor(" + m + "); // " + e[s].name + "\n",
|
|
872
|
+
h.push(m + "_dtor"),
|
|
873
|
+
y.push(e[s].destructorFunction))
|
|
874
|
+
}
|
|
875
|
+
return c && (p += "var ret = retType.fromWireType(rv);\nreturn ret;\n"),
|
|
876
|
+
p += "}\n",
|
|
877
|
+
h.push(p),
|
|
878
|
+
function(t, e) {
|
|
879
|
+
if (!(t instanceof Function))
|
|
880
|
+
throw new TypeError("new_ called with constructor type " + typeof t + " which is not a function");
|
|
881
|
+
var r = ht(t.name || "unknownFunctionName", (function() {}));
|
|
882
|
+
r.prototype = t.prototype;
|
|
883
|
+
var n = new r,
|
|
884
|
+
o = t.apply(n, e);
|
|
885
|
+
return o instanceof Object ? o : n
|
|
886
|
+
}(Function, h).apply(null, y)
|
|
887
|
+
}
|
|
888
|
+
var pe = [],
|
|
889
|
+
de = [{}, {
|
|
890
|
+
value: void 0
|
|
891
|
+
}, {
|
|
892
|
+
value: null
|
|
893
|
+
}, {
|
|
894
|
+
value: !0
|
|
895
|
+
}, {
|
|
896
|
+
value: !1
|
|
897
|
+
}];
|
|
898
|
+
|
|
899
|
+
function he(t) {
|
|
900
|
+
t > 4 && 0 == --de[t].refcount && (de[t] = void 0,
|
|
901
|
+
pe.push(t))
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function ye() {
|
|
905
|
+
for (var t = 0, e = 5; e < de.length; ++e)
|
|
906
|
+
void 0 !== de[e] && ++t;
|
|
907
|
+
return t
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
function me() {
|
|
911
|
+
for (var t = 5; t < de.length; ++t)
|
|
912
|
+
if (void 0 !== de[t])
|
|
913
|
+
return de[t];
|
|
914
|
+
return null
|
|
915
|
+
}
|
|
916
|
+
var ve = {
|
|
917
|
+
toValue: function(t) {
|
|
918
|
+
return t || vt("Cannot use deleted val. handle = " + t),
|
|
919
|
+
de[t].value
|
|
920
|
+
},
|
|
921
|
+
toHandle: function(t) {
|
|
922
|
+
switch (t) {
|
|
923
|
+
case void 0:
|
|
924
|
+
return 1;
|
|
925
|
+
case null:
|
|
926
|
+
return 2;
|
|
927
|
+
case !0:
|
|
928
|
+
return 3;
|
|
929
|
+
case !1:
|
|
930
|
+
return 4;
|
|
931
|
+
default:
|
|
932
|
+
var e = pe.length ? pe.pop() : de.length;
|
|
933
|
+
return de[e] = {
|
|
934
|
+
refcount: 1,
|
|
935
|
+
value: t
|
|
936
|
+
},
|
|
937
|
+
e
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
function ge(t) {
|
|
943
|
+
if (null === t)
|
|
944
|
+
return "null";
|
|
945
|
+
var e = typeof t;
|
|
946
|
+
return "object" === e || "array" === e || "function" === e ? t.toString() : "" + t
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function we(t, e) {
|
|
950
|
+
switch (e) {
|
|
951
|
+
case 2:
|
|
952
|
+
return function(t) {
|
|
953
|
+
return this.fromWireType(M[t >> 2])
|
|
954
|
+
};
|
|
955
|
+
case 3:
|
|
956
|
+
return function(t) {
|
|
957
|
+
return this.fromWireType(I[t >> 3])
|
|
958
|
+
};
|
|
959
|
+
default:
|
|
960
|
+
throw new TypeError("Unknown float type: " + t)
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function be(t, e, r) {
|
|
965
|
+
switch (e) {
|
|
966
|
+
case 0:
|
|
967
|
+
return r ? function(t) {
|
|
968
|
+
return S[t]
|
|
969
|
+
} :
|
|
970
|
+
function(t) {
|
|
971
|
+
return O[t]
|
|
972
|
+
};
|
|
973
|
+
case 1:
|
|
974
|
+
return r ? function(t) {
|
|
975
|
+
return k[t >> 1]
|
|
976
|
+
} :
|
|
977
|
+
function(t) {
|
|
978
|
+
return W[t >> 1]
|
|
979
|
+
};
|
|
980
|
+
case 2:
|
|
981
|
+
return r ? function(t) {
|
|
982
|
+
return j[t >> 2]
|
|
983
|
+
} :
|
|
984
|
+
function(t) {
|
|
985
|
+
return R[t >> 2]
|
|
986
|
+
};
|
|
987
|
+
default:
|
|
988
|
+
throw new TypeError("Unknown integer type: " + t)
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
var Te = {
|
|
992
|
+
mappings: {},
|
|
993
|
+
buffers: [null, [],
|
|
994
|
+
[]
|
|
995
|
+
],
|
|
996
|
+
printChar: function(t, e) {
|
|
997
|
+
var r = Te.buffers[t];
|
|
998
|
+
0 === e || 10 === e ? ((1 === t ? v : g)(UTF8ArrayToString(r, 0)),
|
|
999
|
+
r.length = 0) : r.push(e)
|
|
1000
|
+
},
|
|
1001
|
+
varargs: void 0,
|
|
1002
|
+
get: function() {
|
|
1003
|
+
return Te.varargs += 4,
|
|
1004
|
+
j[Te.varargs - 4 >> 2]
|
|
1005
|
+
},
|
|
1006
|
+
getStr: function(t) {
|
|
1007
|
+
return UTF8ToString(t)
|
|
1008
|
+
},
|
|
1009
|
+
get64: function(t, e) {
|
|
1010
|
+
return t
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
function $e(t) {
|
|
1015
|
+
return t % 4 == 0 && (t % 100 != 0 || t % 400 == 0)
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
function Pe(t, e) {
|
|
1019
|
+
for (var r = 0, n = 0; n <= e; r += t[n++])
|
|
1020
|
+
;
|
|
1021
|
+
return r
|
|
1022
|
+
}
|
|
1023
|
+
var Ae = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
|
|
1024
|
+
De = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1025
|
+
|
|
1026
|
+
function Fe(t, e) {
|
|
1027
|
+
for (var r = new Date(t.getTime()); e > 0;) {
|
|
1028
|
+
var n = $e(r.getFullYear()),
|
|
1029
|
+
o = r.getMonth(),
|
|
1030
|
+
i = (n ? Ae : De)[o];
|
|
1031
|
+
if (!(e > i - r.getDate()))
|
|
1032
|
+
return r.setDate(r.getDate() + e),
|
|
1033
|
+
r;
|
|
1034
|
+
e -= i - r.getDate() + 1,
|
|
1035
|
+
r.setDate(1),
|
|
1036
|
+
o < 11 ? r.setMonth(o + 1) : (r.setMonth(0),
|
|
1037
|
+
r.setFullYear(r.getFullYear() + 1))
|
|
1038
|
+
}
|
|
1039
|
+
return r
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
for (var t = new Array(256), e = 0; e < 256; ++e)
|
|
1043
|
+
t[e] = String.fromCharCode(e);
|
|
1044
|
+
st = t
|
|
1045
|
+
|
|
1046
|
+
mt = o.BindingError = yt(Error, "BindingError"),
|
|
1047
|
+
gt = o.InternalError = yt(Error, "InternalError"),
|
|
1048
|
+
Rt.prototype.isAliasOf = Ct,
|
|
1049
|
+
Rt.prototype.clone = Ft,
|
|
1050
|
+
Rt.prototype.delete = Et,
|
|
1051
|
+
Rt.prototype.isDeleted = St,
|
|
1052
|
+
Rt.prototype.deleteLater = jt,
|
|
1053
|
+
re.prototype.getPointee = Lt,
|
|
1054
|
+
re.prototype.destructor = Gt,
|
|
1055
|
+
re.prototype.argPackAdvance = 8,
|
|
1056
|
+
re.prototype.readValueFromPointer = Bt,
|
|
1057
|
+
re.prototype.deleteObject = Nt,
|
|
1058
|
+
re.prototype.fromWireType = ee,
|
|
1059
|
+
o.getInheritedInstanceCount = Jt,
|
|
1060
|
+
o.getLiveInheritedInstances = Xt,
|
|
1061
|
+
o.flushPendingDeletes = Wt,
|
|
1062
|
+
o.setDelayFunction = Zt,
|
|
1063
|
+
ae = o.UnboundTypeError = yt(Error, "UnboundTypeError"),
|
|
1064
|
+
o.count_emval_handles = ye,
|
|
1065
|
+
o.get_first_emval = me;
|
|
1066
|
+
var Se, import_table_impl = {
|
|
1067
|
+
d: function(t, e, r, n) {
|
|
1068
|
+
abort("Assertion failed: " + UTF8ToString(t) + ", at: " + [e ? UTF8ToString(e) : "unknown filename", r, n ? UTF8ToString(n) : "unknown function"])
|
|
1069
|
+
},
|
|
1070
|
+
g: function(t) {
|
|
1071
|
+
return ke(t + 16) + 16
|
|
1072
|
+
},
|
|
1073
|
+
f: function(t, e, r) {
|
|
1074
|
+
throw new ExceptionInfo(t).init(e, r),t,t
|
|
1075
|
+
},
|
|
1076
|
+
p: function(t, e, r, n, o) {},
|
|
1077
|
+
y: function(t, e, r, n, o) {
|
|
1078
|
+
var i = ut(r);
|
|
1079
|
+
_t(t, {
|
|
1080
|
+
name: e = ct(e),
|
|
1081
|
+
fromWireType: function(t) {
|
|
1082
|
+
return !!t
|
|
1083
|
+
},
|
|
1084
|
+
toWireType: function(t, e) {
|
|
1085
|
+
return e ? n : o
|
|
1086
|
+
},
|
|
1087
|
+
argPackAdvance: 8,
|
|
1088
|
+
readValueFromPointer: function(t) {
|
|
1089
|
+
var n;
|
|
1090
|
+
if (1 === r)
|
|
1091
|
+
n = S;
|
|
1092
|
+
else if (2 === r)
|
|
1093
|
+
n = k;
|
|
1094
|
+
else {
|
|
1095
|
+
if (4 !== r)
|
|
1096
|
+
throw new TypeError("Unknown boolean type size: " + e);
|
|
1097
|
+
n = j
|
|
1098
|
+
}
|
|
1099
|
+
return this.fromWireType(n[t >> i])
|
|
1100
|
+
},
|
|
1101
|
+
destructorFunction: null
|
|
1102
|
+
})
|
|
1103
|
+
},
|
|
1104
|
+
A: function(t, e, r, n, o, i, a, u, s, c, f, l, p) {
|
|
1105
|
+
f = ct(f),
|
|
1106
|
+
i = ie(o, i),
|
|
1107
|
+
u && (u = ie(a, u)),
|
|
1108
|
+
c && (c = ie(s, c)),
|
|
1109
|
+
p = ie(l, p);
|
|
1110
|
+
var d = dt(f);
|
|
1111
|
+
xt(d, (function() {
|
|
1112
|
+
se("Cannot construct " + f + " due to unbound types", [n])
|
|
1113
|
+
})),
|
|
1114
|
+
bt([t, e, r], n ? [n] : [], (function(e) {
|
|
1115
|
+
var r, o;
|
|
1116
|
+
e = e[0],
|
|
1117
|
+
o = n ? (r = e.registeredClass).instancePrototype : Rt.prototype;
|
|
1118
|
+
var a = ht(d, (function() {
|
|
1119
|
+
if (Object.getPrototypeOf(this) !== s)
|
|
1120
|
+
throw new mt("Use 'new' to construct " + f);
|
|
1121
|
+
if (void 0 === l.constructor_body)
|
|
1122
|
+
throw new mt(f + " has no accessible constructor");
|
|
1123
|
+
var t = l.constructor_body[arguments.length];
|
|
1124
|
+
if (void 0 === t)
|
|
1125
|
+
throw new mt("Tried to invoke ctor of " + f + " with invalid number of parameters (" + arguments.length + ") - expected (" + Object.keys(l.constructor_body).toString() + ") parameters instead!");
|
|
1126
|
+
return t.apply(this, arguments)
|
|
1127
|
+
})),
|
|
1128
|
+
s = Object.create(o, {
|
|
1129
|
+
constructor: {
|
|
1130
|
+
value: a
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
a.prototype = s;
|
|
1134
|
+
var l = new Ut(f, a, s, p, r, i, u, c),
|
|
1135
|
+
h = new re(f, l, !0, !1, !1),
|
|
1136
|
+
y = new re(f + "*", l, !1, !1, !1),
|
|
1137
|
+
m = new re(f + " const*", l, !1, !0, !1);
|
|
1138
|
+
return Mt[t] = {
|
|
1139
|
+
pointerType: y,
|
|
1140
|
+
constPointerType: m
|
|
1141
|
+
},
|
|
1142
|
+
ne(d, a),
|
|
1143
|
+
[h, y, m]
|
|
1144
|
+
}))
|
|
1145
|
+
},
|
|
1146
|
+
w: function(t, e, r, n, o, i) {
|
|
1147
|
+
T(e > 0);
|
|
1148
|
+
var a = ce(e, r);
|
|
1149
|
+
o = ie(n, o),
|
|
1150
|
+
bt([], [t], (function(t) {
|
|
1151
|
+
var r = "constructor " + (t = t[0]).name;
|
|
1152
|
+
if (void 0 === t.registeredClass.constructor_body && (t.registeredClass.constructor_body = []),
|
|
1153
|
+
void 0 !== t.registeredClass.constructor_body[e - 1])
|
|
1154
|
+
throw new mt("Cannot register multiple constructors with identical number of parameters (" + (e - 1) + ") for class '" + t.name + "'! Overload resolution is currently only performed using the parameter count, not actual type info!");
|
|
1155
|
+
return t.registeredClass.constructor_body[e - 1] = function() {
|
|
1156
|
+
se("Cannot construct " + t.name + " due to unbound types", a)
|
|
1157
|
+
},
|
|
1158
|
+
bt([], a, (function(n) {
|
|
1159
|
+
return n.splice(1, 0, null),
|
|
1160
|
+
t.registeredClass.constructor_body[e - 1] = le(r, n, null, o, i),
|
|
1161
|
+
[]
|
|
1162
|
+
})),
|
|
1163
|
+
[]
|
|
1164
|
+
}))
|
|
1165
|
+
},
|
|
1166
|
+
c: function(t, e, r, n, o, i, a, u) {
|
|
1167
|
+
var s = ce(r, n);
|
|
1168
|
+
e = ct(e),
|
|
1169
|
+
i = ie(o, i),
|
|
1170
|
+
bt([], [t], (function(t) {
|
|
1171
|
+
var n = (t = t[0]).name + "." + e;
|
|
1172
|
+
|
|
1173
|
+
function o() {
|
|
1174
|
+
se("Cannot call " + n + " due to unbound types", s)
|
|
1175
|
+
}
|
|
1176
|
+
e.startsWith("@@") && (e = Symbol[e.substring(2)]),
|
|
1177
|
+
u && t.registeredClass.pureVirtualFunctions.push(e);
|
|
1178
|
+
var c = t.registeredClass.instancePrototype,
|
|
1179
|
+
f = c[e];
|
|
1180
|
+
return void 0 === f || void 0 === f.overloadTable && f.className !== t.name && f.argCount === r - 2 ? (o.argCount = r - 2,
|
|
1181
|
+
o.className = t.name,
|
|
1182
|
+
c[e] = o) : (It(c, e, n),
|
|
1183
|
+
c[e].overloadTable[r - 2] = o),
|
|
1184
|
+
bt([], s, (function(o) {
|
|
1185
|
+
var u = le(n, o, t, i, a);
|
|
1186
|
+
return void 0 === c[e].overloadTable ? (u.argCount = r - 2,
|
|
1187
|
+
c[e] = u) : c[e].overloadTable[r - 2] = u,
|
|
1188
|
+
[]
|
|
1189
|
+
})),
|
|
1190
|
+
[]
|
|
1191
|
+
}))
|
|
1192
|
+
},
|
|
1193
|
+
x: function(t, e) {
|
|
1194
|
+
_t(t, {
|
|
1195
|
+
name: e = ct(e),
|
|
1196
|
+
fromWireType: function(t) {
|
|
1197
|
+
var e = ve.toValue(t);
|
|
1198
|
+
return he(t),
|
|
1199
|
+
e
|
|
1200
|
+
},
|
|
1201
|
+
toWireType: function(t, e) {
|
|
1202
|
+
return ve.toHandle(e)
|
|
1203
|
+
},
|
|
1204
|
+
argPackAdvance: 8,
|
|
1205
|
+
readValueFromPointer: Bt,
|
|
1206
|
+
destructorFunction: null
|
|
1207
|
+
})
|
|
1208
|
+
},
|
|
1209
|
+
j: function(t, e, r) {
|
|
1210
|
+
var n = ut(r);
|
|
1211
|
+
_t(t, {
|
|
1212
|
+
name: e = ct(e),
|
|
1213
|
+
fromWireType: function(t) {
|
|
1214
|
+
return t
|
|
1215
|
+
},
|
|
1216
|
+
toWireType: function(t, e) {
|
|
1217
|
+
if ("number" != typeof e && "boolean" != typeof e)
|
|
1218
|
+
throw new TypeError('Cannot convert "' + ge(e) + '" to ' + this.name);
|
|
1219
|
+
return e
|
|
1220
|
+
},
|
|
1221
|
+
argPackAdvance: 8,
|
|
1222
|
+
readValueFromPointer: we(e, n),
|
|
1223
|
+
destructorFunction: null
|
|
1224
|
+
})
|
|
1225
|
+
},
|
|
1226
|
+
l: function(t, e, r, n, o, i) {
|
|
1227
|
+
// Registering functions from constructor (;204;)
|
|
1228
|
+
var a = ce(e, r);
|
|
1229
|
+
t = ct(t),
|
|
1230
|
+
o = ie(n, o),
|
|
1231
|
+
xt(t, (function() {
|
|
1232
|
+
se("Cannot call " + t + " due to unbound types", a)
|
|
1233
|
+
}), e - 1),
|
|
1234
|
+
bt([], a, (function(r) {
|
|
1235
|
+
var n = [r[0], null].concat(r.slice(1));
|
|
1236
|
+
return ne(t, le(t, n, null, o, i), e - 1),
|
|
1237
|
+
[]
|
|
1238
|
+
}))
|
|
1239
|
+
},
|
|
1240
|
+
b: function(t, e, r, n, o) {
|
|
1241
|
+
e = ct(e),
|
|
1242
|
+
-1 === o && (o = 4294967295);
|
|
1243
|
+
var i = ut(r),
|
|
1244
|
+
a = function(t) {
|
|
1245
|
+
return t
|
|
1246
|
+
};
|
|
1247
|
+
if (0 === n) {
|
|
1248
|
+
var u = 32 - 8 * r;
|
|
1249
|
+
a = function(t) {
|
|
1250
|
+
return t << u >>> u
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
var s = e.includes("unsigned");
|
|
1254
|
+
_t(t, {
|
|
1255
|
+
name: e,
|
|
1256
|
+
fromWireType: a,
|
|
1257
|
+
toWireType: function(t, r) {
|
|
1258
|
+
if ("number" != typeof r && "boolean" != typeof r)
|
|
1259
|
+
throw new TypeError('Cannot convert "' + ge(r) + '" to ' + this.name);
|
|
1260
|
+
if (r < n || r > o)
|
|
1261
|
+
throw new TypeError('Passing a number "' + ge(r) + '" from JS side to C/C++ side to an argument of type "' + e + '", which is outside the valid range [' + n + ", " + o + "]!");
|
|
1262
|
+
return s ? r >>> 0 : 0 | r
|
|
1263
|
+
},
|
|
1264
|
+
argPackAdvance: 8,
|
|
1265
|
+
readValueFromPointer: be(e, i, 0 !== n),
|
|
1266
|
+
destructorFunction: null
|
|
1267
|
+
})
|
|
1268
|
+
},
|
|
1269
|
+
a: function(t, e, r) {
|
|
1270
|
+
var n = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array][e];
|
|
1271
|
+
|
|
1272
|
+
function o(t) {
|
|
1273
|
+
var e = R,
|
|
1274
|
+
r = e[t >>= 2],
|
|
1275
|
+
o = e[t + 1];
|
|
1276
|
+
return new n(E, o, r)
|
|
1277
|
+
}
|
|
1278
|
+
_t(t, {
|
|
1279
|
+
name: r = ct(r),
|
|
1280
|
+
fromWireType: o,
|
|
1281
|
+
argPackAdvance: 8,
|
|
1282
|
+
readValueFromPointer: o
|
|
1283
|
+
}, {
|
|
1284
|
+
ignoreDuplicateRegistrations: !0
|
|
1285
|
+
})
|
|
1286
|
+
},
|
|
1287
|
+
k: function(t, e) {
|
|
1288
|
+
var r = "std::string" === (e = ct(e));
|
|
1289
|
+
_t(t, {
|
|
1290
|
+
name: e,
|
|
1291
|
+
fromWireType: function(t) {
|
|
1292
|
+
var e, n = R[t >> 2];
|
|
1293
|
+
if (r)
|
|
1294
|
+
for (var o = t + 4, i = 0; i <= n; ++i) {
|
|
1295
|
+
var a = t + 4 + i;
|
|
1296
|
+
if (i == n || 0 == O[a]) {
|
|
1297
|
+
var u = UTF8ToString(o, a - o);
|
|
1298
|
+
void 0 === e ? e = u : (e += String.fromCharCode(0),
|
|
1299
|
+
e += u),
|
|
1300
|
+
o = a + 1
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
else {
|
|
1304
|
+
var s = new Array(n);
|
|
1305
|
+
for (i = 0; i < n; ++i)
|
|
1306
|
+
s[i] = String.fromCharCode(O[t + 4 + i]);
|
|
1307
|
+
e = s.join("")
|
|
1308
|
+
}
|
|
1309
|
+
return We(t),
|
|
1310
|
+
e
|
|
1311
|
+
},
|
|
1312
|
+
toWireType: function(t, e) {
|
|
1313
|
+
e instanceof ArrayBuffer && (e = new Uint8Array(e));
|
|
1314
|
+
var n = "string" == typeof e;
|
|
1315
|
+
n || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array || vt("Cannot pass non-string to std::string");
|
|
1316
|
+
var o = (r && n ? function() {
|
|
1317
|
+
return UTF8CharCount(e)
|
|
1318
|
+
} :
|
|
1319
|
+
function() {
|
|
1320
|
+
return e.length
|
|
1321
|
+
}
|
|
1322
|
+
)(),
|
|
1323
|
+
i = ke(4 + o + 1);
|
|
1324
|
+
if (R[i >> 2] = o,
|
|
1325
|
+
r && n)
|
|
1326
|
+
stringToUTF8Array(e, O, i + 4, o + 1);
|
|
1327
|
+
else if (n)
|
|
1328
|
+
for (var a = 0; a < o; ++a) {
|
|
1329
|
+
var u = e.charCodeAt(a);
|
|
1330
|
+
u > 255 && (We(i),
|
|
1331
|
+
vt("String has UTF-16 code units that do not fit in 8 bits")),
|
|
1332
|
+
O[i + 4 + a] = u
|
|
1333
|
+
}
|
|
1334
|
+
else
|
|
1335
|
+
for (a = 0; a < o; ++a)
|
|
1336
|
+
O[i + 4 + a] = e[a];
|
|
1337
|
+
return null !== t && t.push(We, i),
|
|
1338
|
+
i
|
|
1339
|
+
},
|
|
1340
|
+
argPackAdvance: 8,
|
|
1341
|
+
readValueFromPointer: Bt,
|
|
1342
|
+
destructorFunction: function(t) {
|
|
1343
|
+
We(t)
|
|
1344
|
+
}
|
|
1345
|
+
})
|
|
1346
|
+
},
|
|
1347
|
+
e: function(t, e, r) {
|
|
1348
|
+
var n, o, i, a, u;
|
|
1349
|
+
r = ct(r),
|
|
1350
|
+
2 === e ? (n = UTF16ArrayToString,
|
|
1351
|
+
o = H,
|
|
1352
|
+
a = Y,
|
|
1353
|
+
i = function() {
|
|
1354
|
+
return W
|
|
1355
|
+
},
|
|
1356
|
+
u = 1) : 4 === e && (n = V,
|
|
1357
|
+
o = z,
|
|
1358
|
+
a = B,
|
|
1359
|
+
i = function() {
|
|
1360
|
+
return R
|
|
1361
|
+
},
|
|
1362
|
+
u = 2),
|
|
1363
|
+
_t(t, {
|
|
1364
|
+
name: r,
|
|
1365
|
+
fromWireType: function(t) {
|
|
1366
|
+
for (var r, o = R[t >> 2], a = i(), s = t + 4, c = 0; c <= o; ++c) {
|
|
1367
|
+
var f = t + 4 + c * e;
|
|
1368
|
+
if (c == o || 0 == a[f >> u]) {
|
|
1369
|
+
var l = n(s, f - s);
|
|
1370
|
+
void 0 === r ? r = l : (r += String.fromCharCode(0),
|
|
1371
|
+
r += l),
|
|
1372
|
+
s = f + e
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
return We(t),
|
|
1376
|
+
r
|
|
1377
|
+
},
|
|
1378
|
+
toWireType: function(t, n) {
|
|
1379
|
+
"string" != typeof n && vt("Cannot pass non-string to C++ string type " + r);
|
|
1380
|
+
var i = a(n),
|
|
1381
|
+
s = ke(4 + i + e);
|
|
1382
|
+
return R[s >> 2] = i >> u,
|
|
1383
|
+
o(n, s + 4, i + e),
|
|
1384
|
+
null !== t && t.push(We, s),
|
|
1385
|
+
s
|
|
1386
|
+
},
|
|
1387
|
+
argPackAdvance: 8,
|
|
1388
|
+
readValueFromPointer: Bt,
|
|
1389
|
+
destructorFunction: function(t) {
|
|
1390
|
+
We(t)
|
|
1391
|
+
}
|
|
1392
|
+
})
|
|
1393
|
+
},
|
|
1394
|
+
z: function(t, e) {
|
|
1395
|
+
_t(t, {
|
|
1396
|
+
isVoid: !0,
|
|
1397
|
+
name: e = ct(e),
|
|
1398
|
+
argPackAdvance: 0,
|
|
1399
|
+
fromWireType: function() {},
|
|
1400
|
+
toWireType: function(t, e) {}
|
|
1401
|
+
})
|
|
1402
|
+
},
|
|
1403
|
+
m: he,
|
|
1404
|
+
n: function(t) {
|
|
1405
|
+
t > 4 && (de[t].refcount += 1)
|
|
1406
|
+
},
|
|
1407
|
+
o: function(t, e) {
|
|
1408
|
+
var r, n, o;
|
|
1409
|
+
n = "_emval_take_value",
|
|
1410
|
+
void 0 === (o = lt[r = t]) && vt(n + " has unknown type " + ue(r));
|
|
1411
|
+
var i = (t = o).readValueFromPointer(e);
|
|
1412
|
+
return ve.toHandle(i)
|
|
1413
|
+
},
|
|
1414
|
+
h: function() {
|
|
1415
|
+
abort("")
|
|
1416
|
+
},
|
|
1417
|
+
r: function(t, e, r) {
|
|
1418
|
+
O.copyWithin(t, e, e + r)
|
|
1419
|
+
},
|
|
1420
|
+
s: function(t) {
|
|
1421
|
+
O.length,
|
|
1422
|
+
abort("OOM")
|
|
1423
|
+
},
|
|
1424
|
+
u: function(t, e) {},
|
|
1425
|
+
v: function(t, e) {},
|
|
1426
|
+
i: function(t, e, r, n) {
|
|
1427
|
+
for (var o = 0, i = 0; i < r; i++) {
|
|
1428
|
+
var a = j[e >> 2],
|
|
1429
|
+
u = j[e + 4 >> 2];
|
|
1430
|
+
e += 8;
|
|
1431
|
+
for (var s = 0; s < u; s++)
|
|
1432
|
+
Te.printChar(t, O[a + s]);
|
|
1433
|
+
o += u
|
|
1434
|
+
}
|
|
1435
|
+
return j[n >> 2] = o,
|
|
1436
|
+
0
|
|
1437
|
+
},
|
|
1438
|
+
q: function(t) {
|
|
1439
|
+
t
|
|
1440
|
+
},
|
|
1441
|
+
t: function(t, e, r, n) {
|
|
1442
|
+
return Ee(t, e, r, n)
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
ke = (function() {
|
|
1446
|
+
var import_table = {
|
|
1447
|
+
a: import_table_impl
|
|
1448
|
+
};
|
|
1449
|
+
|
|
1450
|
+
function updateGlobalBufferAndViews(t, e) {
|
|
1451
|
+
var r, n, exports = t.exports;
|
|
1452
|
+
o.asm = exports;
|
|
1453
|
+
b = o.asm.B; // Mem
|
|
1454
|
+
r = b.buffer
|
|
1455
|
+
E = r
|
|
1456
|
+
o.HEAP8 = S = new Int8Array(r),
|
|
1457
|
+
o.HEAP16 = k = new Int16Array(r),
|
|
1458
|
+
o.HEAP32 = j = new Int32Array(r),
|
|
1459
|
+
o.HEAPU8 = O = new Uint8Array(r),
|
|
1460
|
+
o.HEAPU16 = W = new Uint16Array(r),
|
|
1461
|
+
o.HEAPU32 = R = new Uint32Array(r),
|
|
1462
|
+
o.HEAPF32 = M = new Float32Array(r),
|
|
1463
|
+
o.HEAPF64 = I = new Float64Array(r),
|
|
1464
|
+
L = o.asm.D // Table
|
|
1465
|
+
n = o.asm.C // ctor
|
|
1466
|
+
N.unshift(n),
|
|
1467
|
+
function(t) {
|
|
1468
|
+
if (J--,
|
|
1469
|
+
o.monitorRunDependencies && o.monitorRunDependencies(J),
|
|
1470
|
+
0 == J && (null !== X && (clearInterval(X),
|
|
1471
|
+
X = null),
|
|
1472
|
+
Z)) {
|
|
1473
|
+
var e = Z;
|
|
1474
|
+
Z = null,
|
|
1475
|
+
e()
|
|
1476
|
+
}
|
|
1477
|
+
}()
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
function load_wasm(t) {
|
|
1481
|
+
updateGlobalBufferAndViews(t.instance)
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
function getBinaryPromise(e) {
|
|
1485
|
+
return function() {
|
|
1486
|
+
if (!w) {
|
|
1487
|
+
if (readSync)
|
|
1488
|
+
return new Promise((function(t, e) {
|
|
1489
|
+
readSync(Q, (function(e) {
|
|
1490
|
+
t(new Uint8Array(e))
|
|
1491
|
+
}), e)
|
|
1492
|
+
}))
|
|
1493
|
+
}
|
|
1494
|
+
return Promise.resolve().then((function() {
|
|
1495
|
+
return getBinary(Q)
|
|
1496
|
+
}))
|
|
1497
|
+
}().then((function(e) {
|
|
1498
|
+
return WebAssembly.instantiate(e, import_table)
|
|
1499
|
+
})).then((function(t) {
|
|
1500
|
+
return t
|
|
1501
|
+
})).then(e, (function(t) {
|
|
1502
|
+
g("failed to asynchronously prepare wasm: " + t,Q),
|
|
1503
|
+
abort(t)
|
|
1504
|
+
}))
|
|
1505
|
+
}
|
|
1506
|
+
if (J++,
|
|
1507
|
+
o.monitorRunDependencies && o.monitorRunDependencies(J),
|
|
1508
|
+
o.instantiateWasm)
|
|
1509
|
+
try {
|
|
1510
|
+
return o.instantiateWasm(import_table, updateGlobalBufferAndViews)
|
|
1511
|
+
} catch (t) {
|
|
1512
|
+
return g("Module.instantiateWasm callback failed with error: " + t),
|
|
1513
|
+
!1
|
|
1514
|
+
}
|
|
1515
|
+
w || "function" != typeof WebAssembly.instantiate || isDataURI(Q) || isFileURI(Q) || getBinaryPromise(load_wasm)
|
|
1516
|
+
}(),
|
|
1517
|
+
o.___wasm_call_ctors = function() {
|
|
1518
|
+
return (o.___wasm_call_ctors = o.asm.C).apply(null, arguments)
|
|
1519
|
+
},
|
|
1520
|
+
o._malloc = function() {
|
|
1521
|
+
return (ke = o._malloc = o.asm.E).apply(null, arguments)
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
We = o._free = function() {
|
|
1525
|
+
return (We = o._free = o.asm.F).apply(null, arguments)
|
|
1526
|
+
},
|
|
1527
|
+
je = o.___getTypeName = function() {
|
|
1528
|
+
return (je = o.___getTypeName = o.asm.G).apply(null, arguments)
|
|
1529
|
+
};
|
|
1530
|
+
o.___embind_register_native_and_builtin_types = function() {
|
|
1531
|
+
return (o.___embind_register_native_and_builtin_types = o.asm.H).apply(null, arguments)
|
|
1532
|
+
},
|
|
1533
|
+
o.dynCall_jiji = function() {
|
|
1534
|
+
return (o.dynCall_jiji = o.asm.I).apply(null, arguments)
|
|
1535
|
+
},
|
|
1536
|
+
o.dynCall_iiiiij = function() {
|
|
1537
|
+
return (o.dynCall_iiiiij = o.asm.J).apply(null, arguments)
|
|
1538
|
+
},
|
|
1539
|
+
o.dynCall_iiiiijj = function() {
|
|
1540
|
+
return (o.dynCall_iiiiijj = o.asm.K).apply(null, arguments)
|
|
1541
|
+
},
|
|
1542
|
+
o.dynCall_iiiiiijj = function() {
|
|
1543
|
+
return (o.dynCall_iiiiiijj = o.asm.L).apply(null, arguments)
|
|
1544
|
+
},
|
|
1545
|
+
o.dynCall_viijii = function() {
|
|
1546
|
+
return (o.dynCall_viijii = o.asm.M).apply(null, arguments)
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
function ExitStatus(t) {
|
|
1550
|
+
this.name = "ExitStatus",
|
|
1551
|
+
this.message = "Program terminated with exit(" + t + ")",
|
|
1552
|
+
this.status = t
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
function doRun(t) {
|
|
1556
|
+
function postRun() {
|
|
1557
|
+
Se || (Se = !0,o.calledRun = !0,C || (!0,
|
|
1558
|
+
callRuntimeCallbacks(N),
|
|
1559
|
+
o.onRuntimeInitialized && o.onRuntimeInitialized(),
|
|
1560
|
+
function() {
|
|
1561
|
+
if (o.postRun)
|
|
1562
|
+
for ("function" == typeof o.postRun && (o.postRun = [o.postRun]); o.postRun.length;)
|
|
1563
|
+
t = o.postRun.shift(),
|
|
1564
|
+
q.unshift(t);
|
|
1565
|
+
var t;
|
|
1566
|
+
callRuntimeCallbacks(q)
|
|
1567
|
+
}()))
|
|
1568
|
+
}
|
|
1569
|
+
t = t || l
|
|
1570
|
+
J > 0 || (! function preRun() {
|
|
1571
|
+
if (o.preRun)
|
|
1572
|
+
for ("function" == typeof o.preRun && (o.preRun = [o.preRun]); o.preRun.length;)
|
|
1573
|
+
t = o.preRun.shift(),
|
|
1574
|
+
G.unshift(t);
|
|
1575
|
+
var t;
|
|
1576
|
+
callRuntimeCallbacks(G)
|
|
1577
|
+
}(),
|
|
1578
|
+
J > 0 || (o.setStatus ? (o.setStatus("Running..."),
|
|
1579
|
+
setTimeout((function() {
|
|
1580
|
+
setTimeout((function() {
|
|
1581
|
+
o.setStatus("")
|
|
1582
|
+
}), 1),
|
|
1583
|
+
postRun()
|
|
1584
|
+
}), 1)) : postRun()))
|
|
1585
|
+
}
|
|
1586
|
+
if (Z = function t() {
|
|
1587
|
+
Se || doRun(),
|
|
1588
|
+
Se || (Z = t)
|
|
1589
|
+
},
|
|
1590
|
+
o.run = doRun,
|
|
1591
|
+
o.preInit)
|
|
1592
|
+
for ("function" == typeof o.preInit && (o.preInit = [o.preInit]); o.preInit.length > 0;)
|
|
1593
|
+
o.preInit.pop()();
|
|
1594
|
+
doRun();
|
|
1595
|
+
return o;
|
|
1596
|
+
})
|
|
1597
|
+
|
|
1598
|
+
// XXX: With PythonMonkey, the required module
|
|
1599
|
+
// is destructed(?) once the function is called
|
|
1600
|
+
// This is probably not what actaully happened, but
|
|
1601
|
+
// for now, everytime an FP is generated, the entire
|
|
1602
|
+
// WASM module is reloaded as a workaround
|
|
1603
|
+
function instantiateRuntime(){
|
|
1604
|
+
return new Promise((resolve, reject) => {
|
|
1605
|
+
var fpRuntime = AudioFingerprintRuntime()
|
|
1606
|
+
var monitor = setInterval(() => {
|
|
1607
|
+
if (typeof fpRuntime.ExtractQueryFP == "function")
|
|
1608
|
+
clearInterval(monitor) || resolve(fpRuntime)
|
|
1609
|
+
})
|
|
1610
|
+
})
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
function GenerateFP(floatArray) {
|
|
1614
|
+
let PCMBuffer = Float32Array.from(floatArray)
|
|
1615
|
+
logger.info('[afp] input samples n=', PCMBuffer.length)
|
|
1616
|
+
return instantiateRuntime().then((fpRuntime) => {
|
|
1617
|
+
logger.info('[afp] begin fingerprinting')
|
|
1618
|
+
let fp_vector = fpRuntime.ExtractQueryFP(PCMBuffer.buffer)
|
|
1619
|
+
let result_buf = new Uint8Array(fp_vector.size());
|
|
1620
|
+
for (let t = 0; t < fp_vector.size(); t++)
|
|
1621
|
+
result_buf[t] = fp_vector.get(t);
|
|
1622
|
+
return globalThis.b64encode(result_buf)
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
if (typeof exports != 'undefined') /* Node, PythonMonkey */
|
|
1627
|
+
exports.GenerateFP = GenerateFP;
|